home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-03-07 | 19.1 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: GDOpenWindow.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Mar 7 23:28:00 1996, modified Thu Mar 7 23:28:00 1996, creator 'CWIE', type ASCII, 18260 bytes "GDOpenWindow.c" , at 0x47d4 1040 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 2e 63 |..GDOpen|Window.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 47 54 00 | 00 04 10 ad 65 67 d0 ad |.....GT.|....eg..|
|00000060| 65 67 d0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |eg......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 91 1d 00 00 |........|........|
|00000080| 2f 2a 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 2e |/* GDOpe|nWindow.|
|00000090| 63 0d 43 6f 70 79 72 69 | 67 68 74 20 a9 20 31 39 |c.Copyri|ght . 19|
|000000a0| 38 39 2d 31 39 39 35 20 | 44 65 6e 69 73 20 47 2e |89-1995 |Denis G.|
|000000b0| 20 50 65 6c 6c 69 0d 0d | 45 58 41 4d 50 4c 45 3a | Pelli..|EXAMPLE:|
|000000c0| 0d 0d 4f 70 65 6e 20 79 | 6f 75 72 20 77 69 6e 64 |..Open y|our wind|
|000000d0| 6f 77 20 62 79 20 73 61 | 79 69 6e 67 3a 0d 09 77 |ow by sa|ying:..w|
|000000e0| 69 6e 64 6f 77 3d 47 44 | 4f 70 65 6e 57 69 6e 64 |indow=GD|OpenWind|
|000000f0| 6f 77 28 64 65 76 69 63 | 65 29 3b 0d 57 68 65 6e |ow(devic|e);.When|
|00000100| 20 79 6f 75 27 72 65 20 | 74 68 72 6f 75 67 68 20 | you're |through |
|00000110| 77 69 74 68 20 74 68 65 | 20 77 69 6e 64 6f 77 2c |with the| window,|
|00000120| 20 67 65 74 20 72 69 64 | 20 6f 66 20 69 74 20 62 | get rid| of it b|
|00000130| 79 20 63 61 6c 6c 69 6e | 67 3a 0d 09 47 44 44 69 |y callin|g:..GDDi|
|00000140| 73 70 6f 73 65 57 69 6e | 64 6f 77 28 77 69 6e 64 |sposeWin|dow(wind|
|00000150| 6f 77 29 3b 0d 42 65 73 | 69 64 65 73 20 63 6c 6f |ow);.Bes|ides clo|
|00000160| 73 69 6e 67 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |sing the| window |
|00000170| 61 6e 64 20 64 69 73 70 | 6f 73 69 6e 67 20 6f 66 |and disp|osing of|
|00000180| 20 74 68 65 20 61 6c 6c | 6f 63 61 74 65 64 20 6d | the all|ocated m|
|00000190| 65 6d 6f 72 79 20 73 74 | 72 75 63 74 75 72 65 73 |emory st|ructures|
|000001a0| 0d 47 44 44 69 73 70 6f | 73 65 57 69 6e 64 6f 77 |.GDDispo|seWindow|
|000001b0| 20 61 6c 73 6f 20 72 65 | 73 74 6f 72 65 73 20 74 | also re|stores t|
|000001c0| 68 65 20 64 65 76 69 63 | 65 27 73 20 63 6f 6c 6f |he devic|e's colo|
|000001d0| 72 20 74 61 62 6c 65 20 | 61 6e 64 20 63 6c 75 74 |r table |and clut|
|000001e0| 2e 0d 0d 53 55 4d 4d 41 | 52 59 3a 0d 0d 77 69 6e |...SUMMA|RY:..win|
|000001f0| 64 6f 77 3d 47 44 4f 70 | 65 6e 57 69 6e 64 6f 77 |dow=GDOp|enWindow|
|00000200| 28 64 65 76 69 63 65 29 | 20 6f 70 65 6e 73 20 61 |(device)| opens a|
|00000210| 20 66 75 6c 6c 2d 73 63 | 72 65 65 6e 20 77 69 6e | full-sc|reen win|
|00000220| 64 6f 77 20 6f 6e 20 74 | 68 65 20 73 70 65 63 69 |dow on t|he speci|
|00000230| 66 69 65 64 20 73 63 72 | 65 65 6e 2c 0d 63 61 6c |fied scr|een,.cal|
|00000240| 6c 20 47 44 47 72 61 79 | 43 6f 6c 6f 72 54 61 62 |l GDGray|ColorTab|
|00000250| 6c 65 28 64 65 76 69 63 | 65 29 20 77 68 69 63 68 |le(devic|e) which|
|00000260| 20 67 69 76 65 73 20 74 | 68 65 20 64 65 76 69 63 | gives t|he devic|
|00000270| 65 20 61 20 73 74 61 6e | 64 61 72 64 20 67 72 61 |e a stan|dard gra|
|00000280| 79 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 0d 28 69 |y color |table.(i|
|00000290| 66 20 69 74 20 64 6f 65 | 73 6e 27 74 20 61 6c 72 |f it doe|sn't alr|
|000002a0| 65 61 64 79 29 2c 20 61 | 6e 64 20 63 61 6c 6c 73 |eady), a|nd calls|
|000002b0| 20 41 64 64 45 78 70 6c | 69 63 69 74 50 61 6c 65 | AddExpl|icitPale|
|000002c0| 74 74 65 28 77 69 6e 64 | 6f 77 29 2c 20 77 68 69 |tte(wind|ow), whi|
|000002d0| 63 68 20 61 6c 6c 6f 77 | 73 20 79 6f 75 0d 74 6f |ch allow|s you.to|
|000002e0| 20 73 70 65 63 69 66 79 | 20 63 6f 6c 6f 72 73 20 | specify| colors |
|000002f0| 74 6f 20 70 61 69 6e 74 | 20 77 69 74 68 20 62 79 |to paint| with by|
|00000300| 20 75 73 69 6e 67 20 50 | 6d 46 6f 72 65 43 6f 6c | using P|mForeCol|
|00000310| 6f 72 28 29 20 61 6e 64 | 20 50 6d 42 61 63 6b 43 |or() and| PmBackC|
|00000320| 6f 6c 6f 72 28 29 2e 20 | 54 68 65 0d 77 69 6e 64 |olor(). |The.wind|
|00000330| 6f 77 20 74 72 75 6c 79 | 20 66 69 6c 6c 73 20 74 |ow truly| fills t|
|00000340| 68 65 20 73 63 72 65 65 | 6e 3a 20 61 6e 79 20 72 |he scree|n: any r|
|00000350| 6f 75 6e 64 65 64 20 63 | 6f 72 6e 65 72 73 20 61 |ounded c|orners a|
|00000360| 72 65 20 6d 61 64 65 20 | 73 71 75 61 72 65 20 61 |re made |square a|
|00000370| 6e 64 20 69 66 20 74 68 | 65 0d 77 69 6e 64 6f 77 |nd if th|e.window|
|00000380| 20 69 73 20 6f 6e 20 74 | 68 65 20 6d 61 69 6e 20 | is on t|he main |
|00000390| 73 63 72 65 65 6e 20 74 | 68 65 6e 20 74 68 65 20 |screen t|hen the |
|000003a0| 4d 65 6e 75 20 42 61 72 | 20 69 73 20 68 69 64 64 |Menu Bar| is hidd|
|000003b0| 65 6e 2e 20 54 68 65 20 | 73 63 72 65 65 6e 20 6f |en. The |screen o|
|000003c0| 63 63 75 70 69 65 73 0d | 74 68 65 20 63 6f 6e 74 |ccupies.|the cont|
|000003d0| 65 6e 74 20 61 72 65 61 | 20 6f 66 20 74 68 65 20 |ent area| of the |
|000003e0| 77 69 6e 64 6f 77 3b 20 | 74 68 65 20 77 69 6e 64 |window; |the wind|
|000003f0| 6f 77 27 73 20 66 72 61 | 6d 65 20 28 6f 6e 65 2d |ow's fra|me (one-|
|00000400| 70 69 78 65 6c 20 62 6c | 61 63 6b 20 6c 69 6e 65 |pixel bl|ack line|
|00000410| 20 62 6f 72 64 65 72 0d | 61 6e 64 20 74 69 74 6c | border.|and titl|
|00000420| 65 20 62 61 72 29 20 69 | 73 20 6f 66 66 20 74 68 |e bar) i|s off th|
|00000430| 61 74 20 73 63 72 65 65 | 6e 2c 20 62 75 74 20 77 |at scree|n, but w|
|00000440| 69 6c 6c 20 61 70 70 65 | 61 72 20 6f 6e 20 6f 74 |ill appe|ar on ot|
|00000450| 68 65 72 20 73 63 72 65 | 65 6e 73 20 74 68 61 74 |her scre|ens that|
|00000460| 20 66 6f 72 6d 0d 63 6f | 6e 74 69 67 75 6f 75 73 | form.co|ntiguous|
|00000470| 20 70 61 72 74 73 20 6f | 66 20 79 6f 75 72 20 64 | parts o|f your d|
|00000480| 65 73 6b 74 6f 70 2e 20 | 54 68 65 20 65 6c 65 67 |esktop. |The eleg|
|00000490| 61 6e 74 20 73 6f 6c 75 | 74 69 6f 6e 20 74 6f 20 |ant solu|tion to |
|000004a0| 74 68 69 73 2c 20 77 68 | 69 63 68 20 70 65 72 68 |this, wh|ich perh|
|000004b0| 61 70 73 0d 73 6f 6d 65 | 6f 6e 65 20 77 69 6c 6c |aps.some|one will|
|000004c0| 20 69 6d 70 6c 65 6d 65 | 6e 74 2c 20 77 6f 75 6c | impleme|nt, woul|
|000004d0| 64 20 62 65 20 74 6f 20 | 64 65 66 69 6e 65 20 61 |d be to |define a|
|000004e0| 20 6e 65 77 20 77 69 6e | 64 6f 77 20 74 79 70 65 | new win|dow type|
|000004f0| 20 74 68 61 74 20 68 61 | 73 20 6e 6f 20 66 72 61 | that ha|s no fra|
|00000500| 6d 65 2e 0d 0d 47 44 44 | 69 73 70 6f 73 65 57 69 |me...GDD|isposeWi|
|00000510| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 63 6c 6f |ndow(win|dow) clo|
|00000520| 73 65 73 20 61 6e 64 20 | 64 69 73 63 61 72 64 73 |ses and |discards|
|00000530| 20 61 20 63 6f 6c 6f 72 | 20 77 69 6e 64 6f 77 2c | a color| window,|
|00000540| 20 64 69 73 70 6f 73 69 | 6e 67 20 6f 66 20 61 6e | disposi|ng of an|
|00000550| 79 0d 70 61 6c 65 74 74 | 65 20 6f 72 20 63 6f 6c |y.palett|e or col|
|00000560| 6f 72 20 74 61 62 6c 65 | 2c 20 67 65 6e 65 72 61 |or table|, genera|
|00000570| 6c 6c 79 20 75 6e 64 6f | 69 6e 67 20 77 68 61 74 |lly undo|ing what|
|00000580| 65 76 65 72 20 47 44 4f | 70 65 6e 57 69 6e 64 6f |ever GDO|penWindo|
|00000590| 77 31 20 64 69 64 2e 0d | 0d 41 64 64 45 78 70 6c |w1 did..|.AddExpl|
|000005a0| 69 63 69 74 50 61 6c 65 | 74 74 65 28 77 69 6e 64 |icitPale|tte(wind|
|000005b0| 6f 77 29 20 61 64 64 73 | 20 61 20 70 61 6c 65 74 |ow) adds| a palet|
|000005c0| 74 65 20 74 6f 20 61 20 | 63 6f 6c 6f 72 20 77 69 |te to a |color wi|
|000005d0| 6e 64 6f 77 20 6f 72 20 | 47 57 6f 72 6c 64 20 77 |ndow or |GWorld w|
|000005e0| 69 74 68 20 61 6c 6c 0d | 74 68 65 20 63 6f 6c 6f |ith all.|the colo|
|000005f0| 72 73 20 6d 61 72 6b 65 | 64 20 61 73 20 70 6d 45 |rs marke|d as pmE|
|00000600| 78 70 6c 69 63 69 74 2e | 20 54 68 69 73 20 61 6c |xplicit.| This al|
|00000610| 6c 6f 77 73 20 79 6f 75 | 20 74 6f 20 75 73 65 20 |lows you| to use |
|00000620| 50 6d 46 6f 72 65 43 6f | 6c 6f 72 28 29 20 61 6e |PmForeCo|lor() an|
|00000630| 64 0d 50 6d 42 61 63 6b | 43 6f 6c 6f 72 28 29 20 |d.PmBack|Color() |
|00000640| 74 6f 20 73 70 65 63 69 | 66 79 20 74 68 65 20 76 |to speci|fy the v|
|00000650| 61 6c 75 65 20 79 6f 75 | 20 77 61 6e 74 20 70 6f |alue you| want po|
|00000660| 6b 65 64 20 69 6e 74 6f | 20 65 61 63 68 20 70 69 |ked into| each pi|
|00000670| 78 65 6c 20 62 79 20 51 | 75 69 63 6b 44 72 61 77 |xel by Q|uickDraw|
|00000680| 0d 6f 70 65 72 61 74 69 | 6f 6e 73 2c 20 65 2e 67 |.operati|ons, e.g|
|00000690| 2e 20 45 72 61 73 65 52 | 65 63 74 28 29 20 61 6e |. EraseR|ect() an|
|000006a0| 64 20 44 72 61 77 53 74 | 72 69 6e 67 28 29 2e 0d |d DrawSt|ring()..|
|000006b0| 0d 52 65 6d 6f 76 65 50 | 61 6c 65 74 74 65 28 77 |.RemoveP|alette(w|
|000006c0| 69 6e 64 6f 77 29 20 64 | 69 73 70 6f 73 65 73 20 |indow) d|isposes |
|000006d0| 6f 66 20 74 68 65 20 70 | 61 6c 65 74 74 65 20 63 |of the p|alette c|
|000006e0| 72 65 61 74 65 64 20 62 | 79 20 41 64 64 45 78 70 |reated b|y AddExp|
|000006f0| 6c 69 63 69 74 50 61 6c | 65 74 74 65 2e 0d 0d 53 |licitPal|ette...S|
|00000700| 77 61 70 57 69 6e 64 6f | 77 45 78 70 6c 69 63 69 |wapWindo|wExplici|
|00000710| 74 4d 6f 64 65 28 77 69 | 6e 64 6f 77 2c 26 65 78 |tMode(wi|ndow,&ex|
|00000720| 70 6c 69 63 69 74 29 20 | 73 77 61 70 73 20 74 68 |plicit) |swaps th|
|00000730| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 74 68 |e conten|ts of th|
|00000740| 65 20 42 6f 6f 6c 65 61 | 6e 0d 61 72 67 75 6d 65 |e Boolea|n.argume|
|00000750| 6e 74 20 77 69 74 68 20 | 74 68 65 20 22 65 78 70 |nt with |the "exp|
|00000760| 6c 69 63 69 74 22 20 62 | 69 74 20 28 62 69 74 20 |licit" b|it (bit |
|00000770| 31 34 20 6f 66 20 74 68 | 65 20 63 74 46 6c 61 67 |14 of th|e ctFlag|
|00000780| 73 20 66 69 65 6c 64 29 | 20 69 6e 20 74 68 65 20 |s field)| in the |
|00000790| 63 6f 6c 6f 72 0d 74 61 | 62 6c 65 2e 20 54 68 65 |color.ta|ble. The|
|000007a0| 20 75 73 65 20 6f 66 20 | 74 68 69 73 20 62 69 74 | use of |this bit|
|000007b0| 20 69 73 20 64 6f 63 75 | 6d 65 6e 74 65 64 20 69 | is docu|mented i|
|000007c0| 6e 20 22 56 69 64 65 6f | 54 6f 6f 6c 62 6f 78 3a |n "Video|Toolbox:|
|000007d0| 4e 6f 74 65 73 3a 43 6f | 70 79 42 69 74 73 0d 73 |Notes:Co|pyBits.s|
|000007e0| 6c 61 76 69 73 68 6c 79 | 22 2e 20 41 66 74 65 72 |lavishly|". After|
|000007f0| 20 6d 75 63 68 20 65 78 | 70 65 72 69 6d 65 6e 74 | much ex|periment|
|00000800| 61 74 69 6f 6e 20 49 20 | 64 65 63 69 64 65 64 20 |ation I |decided |
|00000810| 74 68 61 74 20 69 74 27 | 73 20 6e 6f 74 20 75 73 |that it'|s not us|
|00000820| 65 66 75 6c 2c 20 62 75 | 74 20 49 0d 6c 65 61 76 |eful, bu|t I.leav|
|00000830| 65 20 74 68 69 73 20 72 | 6f 75 74 69 6e 65 20 68 |e this r|outine h|
|00000840| 65 72 65 20 66 6f 72 20 | 6f 74 68 65 72 73 20 74 |ere for |others t|
|00000850| 68 61 74 20 77 69 73 68 | 20 74 6f 20 65 78 70 65 |hat wish| to expe|
|00000860| 72 69 6d 65 6e 74 2e 20 | 4e 6f 74 65 20 74 68 61 |riment. |Note tha|
|00000870| 74 20 77 68 65 6e 0d 47 | 44 4f 70 65 6e 57 69 6e |t when.G|DOpenWin|
|00000880| 64 6f 77 28 29 20 63 72 | 65 61 74 65 73 20 61 20 |dow() cr|eates a |
|00000890| 77 69 6e 64 6f 77 2c 20 | 74 68 65 20 77 69 6e 64 |window, |the wind|
|000008a0| 6f 77 20 73 68 61 72 65 | 73 20 74 68 65 20 63 6f |ow share|s the co|
|000008b0| 6c 6f 72 20 74 61 62 6c | 65 20 62 65 6c 6f 6e 67 |lor tabl|e belong|
|000008c0| 69 6e 67 20 74 6f 0d 74 | 68 65 20 64 65 76 69 63 |ing to.t|he devic|
|000008d0| 65 2c 20 73 6f 20 63 61 | 6c 6c 69 6e 67 20 53 77 |e, so ca|lling Sw|
|000008e0| 61 70 57 69 6e 64 6f 77 | 45 78 70 6c 69 63 69 74 |apWindow|Explicit|
|000008f0| 4d 6f 64 65 28 29 20 6d | 6f 64 69 66 69 65 73 20 |Mode() m|odifies |
|00000900| 74 68 65 20 73 68 61 72 | 65 64 20 74 61 62 6c 65 |the shar|ed table|
|00000910| 2c 20 69 2e 65 2e 0d 74 | 68 65 20 64 65 76 69 63 |, i.e..t|he devic|
|00000920| 65 27 73 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |e's colo|r table |
|00000930| 69 73 20 6d 6f 64 69 66 | 69 65 64 2e 20 59 6f 75 |is modif|ied. You|
|00000940| 20 73 68 6f 75 6c 64 20 | 72 65 73 74 6f 72 65 20 | should |restore |
|00000950| 69 74 20 62 79 20 63 61 | 6c 6c 69 6e 67 0d 4d 61 |it by ca|lling.Ma|
|00000960| 6b 65 43 6f 6c 6f 72 54 | 61 62 6c 65 45 78 70 6c |keColorT|ableExpl|
|00000970| 69 63 69 74 28 29 20 61 | 67 61 69 6e 2e 20 46 61 |icit() a|gain. Fa|
|00000980| 69 6c 69 6e 67 20 74 6f | 20 72 65 73 74 6f 72 65 |iling to| restore|
|00000990| 20 69 74 20 77 69 6c 6c | 20 68 61 76 65 20 63 6f | it will| have co|
|000009a0| 73 6d 65 74 69 63 0d 61 | 66 74 65 72 65 66 66 65 |smetic.a|ftereffe|
|000009b0| 63 74 73 2c 20 65 76 65 | 6e 20 61 66 74 65 72 20 |cts, eve|n after |
|000009c0| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication|
|000009d0| 20 71 75 69 74 73 2e 20 | 54 68 65 20 6d 6f 73 74 | quits. |The most|
|000009e0| 20 6f 62 76 69 6f 75 73 | 20 61 66 74 65 72 65 66 | obvious| afteref|
|000009f0| 66 65 63 74 20 69 73 0d | 74 68 61 74 20 64 6f 63 |fect is.|that doc|
|00000a00| 75 6d 65 6e 74 73 20 69 | 6e 20 57 6f 72 64 20 77 |uments i|n Word w|
|00000a10| 69 6c 6c 20 62 65 20 6c | 61 72 67 65 6c 79 20 67 |ill be l|argely g|
|00000a20| 72 61 79 2e 0d 0d 47 65 | 74 42 69 74 4d 61 70 50 |ray...Ge|tBitMapP|
|00000a30| 74 72 28 77 69 6e 64 6f | 77 29 20 72 65 74 75 72 |tr(windo|w) retur|
|00000a40| 6e 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ns a poi|nter to |
|00000a50| 74 68 65 20 77 69 6e 64 | 6f 77 27 73 20 62 69 74 |the wind|ow's bit|
|00000a60| 6d 61 70 20 6f 72 20 70 | 69 78 6d 61 70 2e 0d 0d |map or p|ixmap...|
|00000a70| 49 73 47 57 6f 72 6c 64 | 50 74 72 28 77 69 6e 64 |IsGWorld|Ptr(wind|
|00000a80| 6f 77 29 20 72 65 74 75 | 72 6e 73 20 74 72 75 65 |ow) retu|rns true|
|00000a90| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 77 69 6e | only if| the win|
|00000aa0| 64 6f 77 20 69 73 20 61 | 20 47 57 6f 72 6c 64 50 |dow is a| GWorldP|
|00000ab0| 74 72 2e 0d 0d 43 4f 4d | 4d 45 4e 54 53 3a 0d 0d |tr...COM|MENTS:..|
|00000ac0| 50 6c 65 61 73 65 20 72 | 65 61 64 20 22 56 69 64 |Please r|ead "Vid|
|00000ad0| 65 6f 54 6f 6f 6c 62 6f | 78 3a 4e 6f 74 65 73 3a |eoToolbo|x:Notes:|
|00000ae0| 43 6f 70 79 42 69 74 73 | 20 73 6c 61 76 69 73 68 |CopyBits| slavish|
|00000af0| 6c 79 22 2e 20 51 75 69 | 63 6b 44 72 61 77 20 6c |ly". Qui|ckDraw l|
|00000b00| 69 6b 65 73 20 74 6f 0d | 70 69 63 6b 20 61 20 62 |ikes to.|pick a b|
|00000b10| 75 6e 63 68 20 6f 66 20 | 67 6f 6f 64 20 63 6f 6c |unch of |good col|
|00000b20| 6f 72 73 20 61 6e 64 20 | 73 74 75 66 66 20 74 68 |ors and |stuff th|
|00000b30| 65 6d 20 69 6e 20 74 68 | 65 20 63 6c 75 74 2c 20 |em in th|e clut, |
|00000b40| 69 6e 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 72 |in essen|tially r|
|00000b50| 61 6e 64 6f 6d 0d 6f 72 | 64 65 72 2c 20 65 78 63 |andom.or|der, exc|
|00000b60| 65 70 74 20 74 68 61 74 | 20 77 68 69 74 65 20 69 |ept that| white i|
|00000b70| 73 20 66 69 72 73 74 20 | 61 6e 64 20 62 6c 61 63 |s first |and blac|
|00000b80| 6b 20 69 73 20 6c 61 73 | 74 2e 20 49 74 20 77 61 |k is las|t. It wa|
|00000b90| 6e 74 73 20 79 6f 75 20 | 74 6f 20 73 70 65 63 69 |nts you |to speci|
|00000ba0| 66 79 20 61 6e 79 0d 64 | 65 73 69 72 65 64 20 63 |fy any.d|esired c|
|00000bb0| 6f 6c 6f 72 20 61 73 20 | 61 6e 20 52 47 42 20 74 |olor as |an RGB t|
|00000bc0| 72 69 70 6c 65 74 20 61 | 6e 64 20 74 68 65 6e 20 |riplet a|nd then |
|00000bd0| 69 74 20 70 69 63 6b 73 | 20 74 68 65 20 6d 79 73 |it picks| the mys|
|00000be0| 74 65 72 69 6f 75 73 20 | 63 6c 75 74 20 69 6e 64 |terious |clut ind|
|00000bf0| 65 78 20 74 68 61 74 0d | 77 6f 75 6c 64 20 70 72 |ex that.|would pr|
|00000c00| 6f 76 69 64 65 20 74 68 | 65 20 63 6c 6f 73 65 73 |ovide th|e closes|
|00000c10| 74 20 6d 61 74 63 68 2e | 20 49 66 20 79 6f 75 27 |t match.| If you'|
|00000c20| 72 65 20 70 72 6f 63 65 | 73 73 69 6e 67 20 67 72 |re proce|ssing gr|
|00000c30| 61 79 73 63 61 6c 65 20 | 69 6d 61 67 65 73 2c 20 |ayscale |images, |
|00000c40| 74 68 65 6e 0d 51 75 69 | 63 6b 44 72 61 77 27 73 |then.Qui|ckDraw's|
|00000c50| 20 61 70 70 72 6f 61 63 | 68 20 69 6e 76 6f 6c 76 | approac|h involv|
|00000c60| 65 73 20 61 20 6c 6f 74 | 20 6f 66 20 6f 76 65 72 |es a lot| of over|
|00000c70| 68 65 61 64 20 69 6e 76 | 6f 6c 76 69 6e 67 20 69 |head inv|olving i|
|00000c80| 6e 76 65 72 73 65 20 63 | 6f 6c 6f 72 20 74 61 62 |nverse c|olor tab|
|00000c90| 6c 65 73 2c 0d 61 6e 64 | 20 6d 61 6b 65 73 20 74 |les,.and| makes t|
|00000ca0| 68 65 20 6e 75 6d 62 65 | 72 73 20 73 74 6f 72 65 |he numbe|rs store|
|00000cb0| 64 20 69 6e 20 79 6f 75 | 72 20 70 69 78 65 6c 73 |d in you|r pixels|
|00000cc0| 20 6d 65 61 6e 69 6e 67 | 6c 65 73 73 20 28 75 6e | meaning|less (un|
|00000cd0| 6c 65 73 73 20 79 6f 75 | 20 6c 6f 6f 6b 20 74 68 |less you| look th|
|00000ce0| 65 6d 20 75 70 0d 69 6e | 20 74 68 65 20 61 73 73 |em up.in| the ass|
|00000cf0| 6f 63 69 61 74 65 64 20 | 63 6f 6c 6f 72 20 74 61 |ociated |color ta|
|00000d00| 62 6c 65 20 6f 72 20 70 | 61 6c 65 74 74 65 29 2e |ble or p|alette).|
|00000d10| 0d 0d 54 68 65 20 70 68 | 69 6c 6f 73 6f 70 68 79 |..The ph|ilosophy|
|00000d20| 20 6f 66 20 74 68 65 20 | 56 69 64 65 6f 54 6f 6f | of the |VideoToo|
|00000d30| 6c 62 6f 78 20 69 73 20 | 74 6f 20 62 79 70 61 73 |lbox is |to bypas|
|00000d40| 73 20 51 75 69 63 6b 44 | 72 61 77 27 73 20 63 6f |s QuickD|raw's co|
|00000d50| 6c 6f 72 20 6d 6f 64 65 | 6c 2c 20 61 6e 64 0d 77 |lor mode|l, and.w|
|00000d60| 6f 72 6b 20 65 78 70 6c | 69 63 69 74 6c 79 20 77 |ork expl|icitly w|
|00000d70| 69 74 68 20 74 68 65 20 | 6e 75 6d 62 65 72 73 20 |ith the |numbers |
|00000d80| 74 68 61 74 20 61 72 65 | 20 73 74 6f 72 65 64 20 |that are| stored |
|00000d90| 69 6e 20 79 6f 75 72 20 | 70 69 78 65 6c 73 2e 0d |in your |pixels..|
|00000da0| 53 65 74 50 69 78 65 6c | 73 51 75 69 63 6b 6c 79 |SetPixel|sQuickly|
|00000db0| 20 77 69 6c 6c 20 65 66 | 66 69 63 69 65 6e 74 6c | will ef|ficientl|
|00000dc0| 79 20 70 6f 6b 65 20 28 | 6f 72 20 70 65 65 6b 29 |y poke (|or peek)|
|00000dd0| 20 74 68 65 20 6e 75 6d | 62 65 72 73 20 69 6e 20 | the num|bers in |
|00000de0| 79 6f 75 72 20 50 69 78 | 4d 61 70 2e 0d 48 6f 77 |your Pix|Map..How|
|00000df0| 65 76 65 72 2c 20 69 66 | 20 79 6f 75 20 77 61 6e |ever, if| you wan|
|00000e00| 74 20 74 6f 20 75 73 65 | 20 51 75 69 63 6b 44 72 |t to use| QuickDr|
|00000e10| 61 77 27 73 20 68 61 6e | 64 79 20 64 72 61 77 69 |aw's han|dy drawi|
|00000e20| 6e 67 20 6f 70 65 72 61 | 74 69 6f 6e 73 2c 20 65 |ng opera|tions, e|
|00000e30| 73 70 65 63 69 61 6c 6c | 79 0d 45 72 61 73 65 52 |speciall|y.EraseR|
|00000e40| 65 63 74 28 29 20 61 6e | 64 20 44 72 61 77 53 74 |ect() an|d DrawSt|
|00000e50| 72 69 6e 67 28 29 20 74 | 68 65 6e 20 79 6f 75 20 |ring() t|hen you |
|00000e60| 6e 65 65 64 20 61 20 77 | 61 79 20 74 6f 20 73 70 |need a w|ay to sp|
|00000e70| 65 63 69 66 79 20 74 68 | 65 20 66 6f 72 65 67 72 |ecify th|e foregr|
|00000e80| 6f 75 6e 64 20 61 6e 64 | 0d 62 61 63 6b 67 72 6f |ound and|.backgro|
|00000e90| 75 6e 64 20 63 6f 6c 6f | 72 73 2e 20 41 64 64 45 |und colo|rs. AddE|
|00000ea0| 78 70 6c 69 63 69 74 50 | 61 6c 65 74 74 65 28 29 |xplicitP|alette()|
|00000eb0| 20 67 69 76 65 73 20 79 | 6f 75 72 20 77 69 6e 64 | gives y|our wind|
|00000ec0| 6f 77 20 61 20 70 61 6c | 65 74 74 65 20 69 6e 20 |ow a pal|ette in |
|00000ed0| 77 68 69 63 68 20 61 6c | 6c 0d 74 68 65 20 63 6f |which al|l.the co|
|00000ee0| 6c 6f 72 73 20 61 72 65 | 20 6d 61 72 6b 65 64 20 |lors are| marked |
|00000ef0| 61 73 20 70 6d 45 78 70 | 6c 69 63 69 74 2e 20 54 |as pmExp|licit. T|
|00000f00| 68 69 73 20 74 65 6c 6c | 73 20 74 68 65 20 70 61 |his tell|s the pa|
|00000f10| 6c 65 74 74 65 20 6d 61 | 6e 61 67 65 72 20 74 6f |lette ma|nager to|
|00000f20| 20 75 73 65 20 79 6f 75 | 72 0d 61 72 67 75 6d 65 | use you|r.argume|
|00000f30| 6e 74 73 20 74 6f 20 50 | 6d 46 6f 72 65 43 6f 6c |nts to P|mForeCol|
|00000f40| 6f 72 28 29 20 61 6e 64 | 20 50 6d 42 61 63 6b 43 |or() and| PmBackC|
|00000f50| 6f 6c 6f 72 28 29 20 6c | 69 74 65 72 61 6c 6c 79 |olor() l|iterally|
|00000f60| 2e 0d 0d 49 20 73 75 67 | 67 65 73 74 20 74 68 61 |...I sug|gest tha|
|00000f70| 74 20 79 6f 75 20 63 6f | 6e 74 72 6f 6c 20 74 68 |t you co|ntrol th|
|00000f80| 65 20 63 6c 75 74 20 62 | 79 20 63 61 6c 6c 69 6e |e clut b|y callin|
|00000f90| 67 20 47 44 55 6e 63 6f | 72 72 65 63 74 65 64 47 |g GDUnco|rrectedG|
|00000fa0| 61 6d 6d 61 28 29 20 61 | 6e 64 0d 47 44 53 65 74 |amma() a|nd.GDSet|
|00000fb0| 45 6e 74 72 69 65 73 28 | 29 2c 20 73 69 6e 63 65 |Entries(|), since|
|00000fc0| 20 74 68 65 73 65 20 63 | 61 6c 6c 73 20 64 69 72 | these c|alls dir|
|00000fd0| 65 63 74 6c 79 20 63 6f | 6e 74 72 6f 6c 20 74 68 |ectly co|ntrol th|
|00000fe0| 65 20 76 69 64 65 6f 20 | 64 65 76 69 63 65 20 64 |e video |device d|
|00000ff0| 72 69 76 65 72 2c 0d 62 | 79 70 61 73 73 69 6e 67 |river,.b|ypassing|
|00001000| 20 74 68 65 20 43 6f 6c | 6f 72 20 4d 61 6e 61 67 | the Col|or Manag|
|00001010| 65 72 2e 20 53 69 6e 63 | 65 20 74 68 65 20 43 6f |er. Sinc|e the Co|
|00001020| 6c 6f 72 20 61 6e 64 20 | 50 61 6c 65 74 74 65 20 |lor and |Palette |
|00001030| 4d 61 6e 61 67 65 72 73 | 20 64 6f 6e 27 74 20 6b |Managers| don't k|
|00001040| 6e 6f 77 0d 74 68 61 74 | 20 79 6f 75 27 76 65 20 |now.that| you've |
|00001050| 63 68 61 6e 67 65 64 20 | 74 68 65 20 63 6f 6c 6f |changed |the colo|
|00001060| 72 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 74 68 |r enviro|nment th|
|00001070| 65 79 20 63 61 6e 27 74 | 20 72 65 61 63 74 20 74 |ey can't| react t|
|00001080| 6f 20 69 74 2c 20 61 6e | 64 20 77 69 6c 6c 0d 70 |o it, an|d will.p|
|00001090| 61 73 73 69 76 65 6c 79 | 20 6c 65 74 20 79 6f 75 |assively| let you|
|000010a0| 20 63 6f 6e 74 69 6e 75 | 65 20 74 6f 20 73 70 65 | continu|e to spe|
|000010b0| 63 69 66 79 20 63 6f 6c | 6f 72 73 20 62 79 20 74 |cify col|ors by t|
|000010c0| 68 65 69 72 20 63 6c 75 | 74 20 69 6e 64 65 78 2e |heir clu|t index.|
|000010d0| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 0d 74 68 | For exa|mple,.th|
|000010e0| 65 20 50 61 6c 65 74 74 | 65 20 4d 61 6e 61 67 65 |e Palett|e Manage|
|000010f0| 72 20 72 65 6c 69 67 69 | 6f 75 73 6c 79 20 62 65 |r religi|ously be|
|00001100| 6c 69 65 76 65 73 20 74 | 68 61 74 20 74 68 65 20 |lieves t|hat the |
|00001110| 66 69 72 73 74 20 63 6c | 75 74 20 65 6e 74 72 79 |first cl|ut entry|
|00001120| 20 73 68 6f 75 6c 64 20 | 62 65 0d 77 68 69 74 65 | should |be.white|
|00001130| 20 61 6e 64 20 74 68 65 | 20 6c 61 73 74 20 6f 6e | and the| last on|
|00001140| 65 20 62 6c 61 63 6b 2c | 20 61 6e 64 20 69 74 20 |e black,| and it |
|00001150| 77 69 6c 6c 20 63 68 61 | 6e 67 65 20 74 68 65 6d |will cha|nge them|
|00001160| 20 62 61 63 6b 20 74 6f | 20 74 68 6f 73 65 20 76 | back to| those v|
|00001170| 61 6c 75 65 73 20 69 66 | 0d 79 6f 75 20 63 68 61 |alues if|.you cha|
|00001180| 6e 67 65 20 74 68 65 6d | 20 61 6e 64 20 69 74 20 |nge them| and it |
|00001190| 66 69 6e 64 73 20 6f 75 | 74 20 61 62 6f 75 74 20 |finds ou|t about |
|000011a0| 69 74 2e 20 49 66 20 79 | 6f 75 20 75 73 65 20 74 |it. If y|ou use t|
|000011b0| 68 65 20 43 6f 6c 6f 72 | 20 4d 61 6e 61 67 65 72 |he Color| Manager|
|000011c0| 0d 53 65 74 45 6e 74 72 | 69 65 73 20 63 61 6c 6c |.SetEntr|ies call|
|000011d0| 20 74 68 65 6e 20 74 68 | 65 20 50 61 6c 65 74 74 | then th|e Palett|
|000011e0| 65 72 20 4d 61 6e 67 65 | 72 20 57 49 4c 4c 20 66 |er Mange|r WILL f|
|000011f0| 69 6e 64 20 6f 75 74 20 | 62 65 63 61 75 73 65 20 |ind out |because |
|00001200| 61 20 72 65 63 6f 72 64 | 20 69 73 20 6d 61 64 65 |a record| is made|
|00001210| 0d 69 6e 20 74 68 65 20 | 43 6f 6c 6f 72 54 61 62 |.in the |ColorTab|
|00001220| 6c 65 2e 20 43 61 6c 6c | 69 6e 67 20 47 44 53 65 |le. Call|ing GDSe|
|00001230| 74 45 6e 74 72 69 65 73 | 28 29 20 62 79 70 61 73 |tEntries|() bypas|
|00001240| 73 65 73 20 74 68 65 20 | 43 6f 6c 6f 72 20 4d 61 |ses the |Color Ma|
|00001250| 6e 61 67 65 72 2e 20 49 | 6e 73 74 65 61 64 2c 0d |nager. I|nstead,.|
|00001260| 74 68 65 20 76 69 64 65 | 6f 20 64 65 76 69 63 65 |the vide|o device|
|00001270| 20 64 72 69 76 65 72 20 | 77 72 69 74 65 73 20 64 | driver |writes d|
|00001280| 69 72 65 63 74 6c 79 20 | 74 6f 20 74 68 65 20 63 |irectly |to the c|
|00001290| 6c 75 74 20 61 6e 64 20 | 74 68 65 20 43 6f 6c 6f |lut and |the Colo|
|000012a0| 72 54 61 62 6c 65 20 69 | 73 20 6e 6f 74 0d 6d 6f |rTable i|s not.mo|
|000012b0| 64 69 66 69 65 64 2e 20 | 4f 66 20 63 6f 75 72 73 |dified. |Of cours|
|000012c0| 65 2c 20 74 68 69 73 20 | 6d 65 61 6e 73 20 74 68 |e, this |means th|
|000012d0| 61 74 20 79 6f 75 20 73 | 68 6f 75 6c 64 20 69 67 |at you s|hould ig|
|000012e0| 6e 6f 72 65 20 74 68 65 | 20 43 6f 6c 6f 72 54 61 |nore the| ColorTa|
|000012f0| 62 6c 65 20 73 69 6e 63 | 65 20 69 74 0d 77 69 6c |ble sinc|e it.wil|
|00001300| 6c 20 6e 6f 20 6c 6f 6e | 67 65 72 20 72 65 66 6c |l no lon|ger refl|
|00001310| 65 63 74 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ect the |contents|
|00001320| 20 6f 66 20 74 68 65 20 | 63 6c 75 74 2e 0d 0d 45 | of the |clut...E|
|00001330| 76 65 72 79 20 74 69 6d | 65 20 79 6f 75 20 61 63 |very tim|e you ac|
|00001340| 63 65 73 73 20 74 68 65 | 20 73 74 64 69 6f 20 70 |cess the| stdio p|
|00001350| 61 63 6b 61 67 65 2c 20 | 65 2e 67 2e 20 70 72 69 |ackage, |e.g. pri|
|00001360| 6e 74 66 20 6f 72 20 67 | 65 74 63 68 28 29 2c 20 |ntf or g|etch(), |
|00001370| 54 48 49 4e 4b 20 43 20 | 77 69 6c 6c 0d 6d 6f 76 |THINK C |will.mov|
|00001380| 65 20 74 68 65 20 63 6f | 6e 73 6f 6c 65 20 77 69 |e the co|nsole wi|
|00001390| 6e 64 6f 77 20 74 6f 20 | 74 68 65 20 66 72 6f 6e |ndow to |the fron|
|000013a0| 74 2c 20 77 68 69 63 68 | 20 6d 61 79 20 6f 62 73 |t, which| may obs|
|000013b0| 63 75 72 65 20 79 6f 75 | 72 20 77 69 6e 64 6f 77 |cure you|r window|
|000013c0| 2e 20 59 6f 75 20 63 61 | 6e 0d 62 72 69 6e 67 20 |. You ca|n.bring |
|000013d0| 79 6f 75 72 20 77 69 6e | 64 6f 77 20 62 61 63 6b |your win|dow back|
|000013e0| 20 74 6f 20 74 68 65 20 | 66 72 6f 6e 74 20 62 79 | to the |front by|
|000013f0| 20 63 61 6c 6c 69 6e 67 | 20 42 72 69 6e 67 54 6f | calling| BringTo|
|00001400| 46 72 6f 6e 74 28 29 20 | 6f 72 20 53 65 6c 65 63 |Front() |or Selec|
|00001410| 74 57 69 6e 64 77 6f 28 | 29 2e 0d 0d 4e 4f 54 45 |tWindwo(|)...NOTE|
|00001420| 3a 0d 54 6f 6d 20 42 75 | 73 65 79 20 28 62 75 73 |:.Tom Bu|sey (bus|
|00001430| 65 79 40 69 6e 64 69 61 | 6e 61 2e 65 64 75 29 20 |ey@india|na.edu) |
|00001440| 77 72 69 74 65 73 3a 20 | 22 49 27 6d 20 75 73 69 |writes: |"I'm usi|
|00001450| 6e 67 20 61 6e 20 38 2d | 62 69 74 20 53 75 70 65 |ng an 8-|bit Supe|
|00001460| 72 4d 61 63 20 43 6f 6c | 6f 72 43 61 72 64 0d 74 |rMac Col|orCard.t|
|00001470| 68 61 74 20 61 20 75 73 | 65 64 20 63 6f 6d 70 75 |hat a us|ed compu|
|00001480| 74 65 72 20 64 65 61 6c | 65 72 20 67 61 76 65 20 |ter deal|er gave |
|00001490| 6d 65 20 77 68 65 6e 20 | 49 20 6f 72 64 65 72 65 |me when |I ordere|
|000014a0| 64 20 61 20 54 6f 62 79 | 20 63 61 72 64 2e 20 49 |d a Toby| card. I|
|000014b0| 20 64 69 73 63 6f 76 65 | 72 65 64 0d 74 68 61 74 | discove|red.that|
|000014c0| 20 74 68 65 20 73 74 61 | 74 75 73 20 61 6e 64 20 | the sta|tus and |
|000014d0| 63 6f 6e 74 72 6f 6c 20 | 63 61 6c 6c 73 20 66 6f |control |calls fo|
|000014e0| 72 20 47 44 55 6e 63 6f | 72 72 65 63 74 65 64 47 |r GDUnco|rrectedG|
|000014f0| 61 6d 6d 61 20 72 65 74 | 75 72 6e 20 2d 31 37 20 |amma ret|urn -17 |
|00001500| 61 6e 64 20 2d 31 38 0d | 72 65 73 70 65 63 74 69 |and -18.|respecti|
|00001510| 76 65 6c 79 2c 20 77 68 | 69 63 68 20 6d 65 61 6e |vely, wh|ich mean|
|00001520| 73 20 74 68 61 74 20 74 | 68 65 20 64 72 69 76 65 |s that t|he drive|
|00001530| 72 20 64 6f 65 73 6e 27 | 74 20 73 75 70 70 6f 72 |r doesn'|t suppor|
|00001540| 74 20 64 69 66 66 65 72 | 65 6e 74 20 67 61 6d 6d |t differ|ent gamm|
|00001550| 61 73 2e 0d 47 44 55 6e | 63 6f 72 72 65 63 74 65 |as..GDUn|correcte|
|00001560| 64 47 61 6d 6d 61 20 72 | 65 74 75 72 6e 73 20 61 |dGamma r|eturns a|
|00001570| 6e 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 2c |n error |message,|
|00001580| 20 62 75 74 20 47 44 4f | 70 65 6e 57 69 6e 64 6f | but GDO|penWindo|
|00001590| 77 20 64 6f 65 73 6e 27 | 74 20 75 73 65 20 74 68 |w doesn'|t use th|
|000015a0| 65 0d 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 20 |e.error |message |
|000015b0| 6f 72 20 70 61 73 73 20 | 69 74 20 62 61 63 6b 20 |or pass |it back |
|000015c0| 74 6f 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 70 |to the c|alling p|
|000015d0| 72 6f 67 72 61 6d 2e 20 | 49 27 6d 20 77 6f 6e 64 |rogram. |I'm wond|
|000015e0| 65 72 69 6e 67 20 69 66 | 20 74 68 65 72 65 20 61 |ering if| there a|
|000015f0| 72 65 0d 70 65 6f 70 6c | 65 20 75 73 69 6e 67 20 |re.peopl|e using |
|00001600| 47 44 4f 70 65 6e 57 69 | 6e 64 6f 77 20 77 68 6f |GDOpenWi|ndow who|
|00001610| 20 74 68 69 6e 6b 20 74 | 68 61 74 20 74 68 65 79 | think t|hat they|
|00001620| 20 61 72 65 20 67 65 74 | 74 69 6e 67 20 61 20 6c | are get|ting a l|
|00001630| 69 6e 65 61 72 20 67 61 | 6d 6d 61 20 62 75 74 20 |inear ga|mma but |
|00001640| 77 68 6f 0d 61 72 65 20 | 61 63 74 75 61 6c 6c 79 |who.are |actually|
|00001650| 20 67 65 74 74 69 6e 67 | 20 61 6e 20 65 72 72 6f | getting| an erro|
|00001660| 72 20 6d 65 73 73 61 67 | 65 20 61 6e 64 20 6e 6f |r messag|e and no|
|00001670| 74 20 6c 65 61 72 6e 69 | 6e 67 20 61 62 6f 75 74 |t learni|ng about|
|00001680| 20 69 74 2e 22 0d 20 20 | 20 20 20 54 6f 6d 27 73 | it.". | Tom's|
|00001690| 20 66 61 63 74 73 20 61 | 72 65 20 72 69 67 68 74 | facts a|re right|
|000016a0| 2c 20 62 75 74 20 68 65 | 20 6e 65 65 64 6e 27 74 |, but he| needn't|
|000016b0| 20 77 6f 72 72 79 2e 20 | 41 20 66 65 77 20 76 69 | worry. |A few vi|
|000016c0| 64 65 6f 20 64 72 69 76 | 65 72 73 2c 20 65 2e 67 |deo driv|ers, e.g|
|000016d0| 2e 0d 52 61 64 69 75 73 | 20 50 6f 77 65 72 56 69 |..Radius| PowerVi|
|000016e0| 65 77 2c 20 61 6e 64 20 | 61 70 70 61 72 65 6e 74 |ew, and |apparent|
|000016f0| 6c 79 20 74 68 65 20 53 | 75 70 65 72 4d 61 63 20 |ly the S|uperMac |
|00001700| 43 6f 6c 6f 72 43 61 72 | 64 2c 20 64 6f 6e 27 74 |ColorCar|d, don't|
|00001710| 20 69 6d 70 6c 65 6d 65 | 6e 74 20 67 61 6d 6d 61 | impleme|nt gamma|
|00001720| 0d 74 61 62 6c 65 73 20 | 61 74 20 61 6c 6c 2c 20 |.tables |at all, |
|00001730| 62 75 74 20 74 68 65 20 | 65 72 72 6f 72 20 66 72 |but the |error fr|
|00001740| 6f 6d 20 47 44 55 6e 63 | 6f 72 72 65 63 74 65 64 |om GDUnc|orrected|
|00001750| 47 61 6d 6d 61 20 69 73 | 20 70 72 6f 62 61 62 6c |Gamma is| probabl|
|00001760| 79 20 6e 6f 74 20 61 20 | 63 6f 6e 63 65 72 6e 2e |y not a |concern.|
|00001770| 0d 54 68 65 20 72 65 61 | 6c 20 74 65 73 74 20 69 |.The rea|l test i|
|00001780| 73 20 74 6f 20 72 75 6e | 20 54 69 6d 65 56 69 64 |s to run| TimeVid|
|00001790| 65 6f 2e 20 54 69 6d 65 | 56 69 64 65 6f 20 64 6f |eo. Time|Video do|
|000017a0| 65 73 20 61 20 77 72 69 | 74 65 2d 61 6e 64 2d 72 |es a wri|te-and-r|
|000017b0| 65 61 64 2d 62 61 63 6b | 20 74 65 73 74 20 6f 66 |ead-back| test of|
|000017c0| 0d 74 68 65 20 63 6c 75 | 74 20 6f 66 20 79 6f 75 |.the clu|t of you|
|000017d0| 72 20 76 69 64 65 6f 20 | 63 61 72 64 2e 20 49 66 |r video |card. If|
|000017e0| 20 74 68 61 74 20 74 65 | 73 74 20 70 61 73 73 65 | that te|st passe|
|000017f0| 73 20 74 68 65 6e 20 79 | 6f 75 20 63 61 6e 20 73 |s then y|ou can s|
|00001800| 61 66 65 6c 79 20 63 6f | 6e 63 6c 75 64 65 0d 74 |afely co|nclude.t|
|00001810| 68 61 74 20 74 68 65 72 | 65 27 73 20 6e 6f 20 67 |hat ther|e's no g|
|00001820| 61 6d 6d 61 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |amma tra|nslation|
|00001830| 20 67 6f 69 6e 67 20 6f | 6e 2e 20 53 6f 2c 20 61 | going o|n. So, a|
|00001840| 73 20 6e 65 61 72 6c 79 | 20 65 76 65 72 79 20 64 |s nearly| every d|
|00001850| 6f 63 75 6d 65 6e 74 20 | 69 6e 20 74 68 65 0d 56 |ocument |in the.V|
|00001860| 69 64 65 6f 54 6f 6f 6c | 62 6f 78 20 73 61 79 73 |ideoTool|box says|
|00001870| 3a 20 72 75 6e 20 54 69 | 6d 65 56 69 64 65 6f 20 |: run Ti|meVideo |
|00001880| 61 6e 64 20 72 65 61 64 | 20 74 68 65 20 72 65 70 |and read| the rep|
|00001890| 6f 72 74 2e 0d 20 20 20 | 20 20 48 65 72 65 27 73 |ort.. | Here's|
|000018a0| 20 68 6f 77 20 67 61 6d | 6d 61 20 74 61 62 6c 65 | how gam|ma table|
|000018b0| 73 20 77 6f 72 6b 2e 20 | 41 63 63 6f 72 64 69 6e |s work. |Accordin|
|000018c0| 67 20 74 6f 20 74 68 65 | 20 41 70 70 6c 65 20 6d |g to the| Apple m|
|000018d0| 61 6e 75 61 6c 20 28 44 | 65 73 69 67 6e 69 6e 67 |anual (D|esigning|
|000018e0| 0d 43 61 72 64 73 20 61 | 6e 64 20 44 72 69 76 65 |.Cards a|nd Drive|
|000018f0| 72 73 29 2c 20 74 68 65 | 20 76 61 6c 75 65 73 20 |rs), the| values |
|00001900| 69 6e 20 74 68 65 20 72 | 67 62 20 74 72 69 70 6c |in the r|gb tripl|
|00001910| 65 74 73 20 74 68 61 74 | 20 79 6f 75 20 73 75 70 |ets that| you sup|
|00001920| 70 6c 79 20 69 6e 20 61 | 0d 63 73 63 53 65 74 45 |ply in a|.cscSetE|
|00001930| 6e 74 72 69 65 73 20 63 | 61 6c 6c 20 74 6f 20 74 |ntries c|all to t|
|00001940| 68 65 20 76 69 64 65 6f | 20 64 72 69 76 65 72 20 |he video| driver |
|00001950| 61 72 65 20 66 69 72 73 | 74 20 74 72 61 6e 73 6c |are firs|t transl|
|00001960| 61 74 65 64 20 76 69 61 | 20 74 68 65 20 67 61 6d |ated via| the gam|
|00001970| 6d 61 20 74 61 62 6c 65 | 0d 28 65 61 63 68 20 72 |ma table|.(each r|
|00001980| 2c 67 2c 20 61 6e 64 20 | 62 20 63 6f 6d 70 6f 6e |,g, and |b compon|
|00001990| 65 6e 74 20 73 65 70 61 | 72 61 74 65 6c 79 29 20 |ent sepa|rately) |
|000019a0| 62 65 66 6f 72 65 20 62 | 65 69 6e 67 20 6c 6f 61 |before b|eing loa|
|000019b0| 64 65 64 20 69 6e 74 6f | 20 74 68 65 20 43 4c 55 |ded into| the CLU|
|000019c0| 54 0d 68 61 72 64 77 61 | 72 65 20 74 61 62 6c 65 |T.hardwa|re table|
|000019d0| 2e 20 4d 6f 73 74 20 64 | 72 69 76 65 72 73 20 6d |. Most d|rivers m|
|000019e0| 61 69 6e 74 61 69 6e 20 | 61 20 67 61 6d 6d 61 20 |aintain |a gamma |
|000019f0| 74 61 62 6c 65 20 69 6e | 74 65 72 6e 61 6c 6c 79 |table in|ternally|
|00001a00| 20 28 69 6e 20 63 6f 6d | 70 75 74 65 72 0d 6d 65 | (in com|puter.me|
|00001a10| 6d 6f 72 79 29 20 61 6e | 64 20 61 6c 6c 6f 77 20 |mory) an|d allow |
|00001a20| 79 6f 75 20 74 6f 20 67 | 65 74 20 61 6e 64 20 73 |you to g|et and s|
|00001a30| 65 74 20 69 74 20 76 69 | 61 20 74 68 65 20 47 44 |et it vi|a the GD|
|00001a40| 47 65 74 47 61 6d 6d 61 | 20 61 6e 64 20 47 44 53 |GetGamma| and GDS|
|00001a50| 65 74 47 61 6d 6d 61 20 | 63 61 6c 6c 73 2e 0d 41 |etGamma |calls..A|
|00001a60| 20 66 65 77 20 76 69 64 | 65 6f 20 64 72 69 76 65 | few vid|eo drive|
|00001a70| 72 73 20 28 52 61 64 69 | 75 73 20 50 6f 77 65 72 |rs (Radi|us Power|
|00001a80| 56 69 65 77 2c 20 53 75 | 70 65 72 4d 61 63 20 43 |View, Su|perMac C|
|00001a90| 6f 6c 6f 72 43 61 72 64 | 29 20 64 6f 6e 27 74 20 |olorCard|) don't |
|00001aa0| 73 75 70 70 6f 72 74 20 | 67 61 6d 6d 61 0d 74 61 |support |gamma.ta|
|00001ab0| 62 6c 65 73 2e 20 54 68 | 65 79 20 6c 6f 61 64 20 |bles. Th|ey load |
|00001ac0| 79 6f 75 72 20 72 67 62 | 20 76 61 6c 75 65 73 20 |your rgb| values |
|00001ad0| 64 69 72 65 63 74 6c 79 | 20 69 6e 74 6f 20 74 68 |directly| into th|
|00001ae0| 65 20 43 4c 55 54 2c 20 | 77 69 74 68 6f 75 74 20 |e CLUT, |without |
|00001af0| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 2e 0d 48 6f 77 |translat|ion..How|
|00001b00| 65 76 65 72 2c 20 66 6f | 72 20 75 73 65 72 73 20 |ever, fo|r users |
|00001b10| 6f 66 20 74 68 65 20 56 | 69 64 65 6f 54 6f 6f 6c |of the V|ideoTool|
|00001b20| 62 6f 78 20 74 68 61 74 | 27 73 20 75 73 75 61 6c |box that|'s usual|
|00001b30| 6c 79 20 66 69 6e 65 2c | 20 73 69 6e 63 65 20 74 |ly fine,| since t|
|00001b40| 68 61 74 27 73 20 65 78 | 61 63 74 6c 79 0d 74 68 |hat's ex|actly.th|
|00001b50| 65 20 62 65 68 61 76 69 | 6f 72 20 74 68 61 74 20 |e behavi|or that |
|00001b60| 77 65 20 72 6f 75 74 69 | 6e 65 6c 79 20 72 65 71 |we routi|nely req|
|00001b70| 75 65 73 74 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |uest by |calling |
|00001b80| 47 44 55 6e 63 6f 72 72 | 65 63 74 65 64 47 61 6d |GDUncorr|ectedGam|
|00001b90| 6d 61 2e 20 4f 66 20 63 | 6f 75 72 73 65 2c 0d 69 |ma. Of c|ourse,.i|
|00001ba0| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 6c 6f |f you wa|nt to lo|
|00001bb0| 61 64 20 61 20 63 75 73 | 74 6f 6d 20 67 61 6d 6d |ad a cus|tom gamm|
|00001bc0| 61 20 74 61 62 6c 65 2c | 20 6f 74 68 65 72 20 74 |a table,| other t|
|00001bd0| 68 61 6e 20 74 68 65 20 | 69 64 65 6e 74 69 74 79 |han the |identity|
|00001be0| 0d 74 72 61 6e 73 66 6f | 72 6d 61 74 69 6f 6e 2c |.transfo|rmation,|
|00001bf0| 20 74 68 65 6e 20 79 6f | 75 27 6c 6c 20 62 65 20 | then yo|u'll be |
|00001c00| 63 61 6c 6c 69 6e 67 20 | 47 44 53 65 74 47 61 6d |calling |GDSetGam|
|00001c10| 6d 61 2c 20 61 6e 64 20 | 79 6f 75 20 73 68 6f 75 |ma, and |you shou|
|00001c20| 6c 64 20 6d 61 6b 65 20 | 73 75 72 65 20 69 74 0d |ld make |sure it.|
|00001c30| 64 6f 65 73 20 6e 6f 74 | 20 72 65 74 75 72 6e 20 |does not| return |
|00001c40| 61 6e 20 65 72 72 6f 72 | 2e 20 28 41 6c 61 73 2c |an error|. (Alas,|
|00001c50| 20 74 68 65 20 52 61 64 | 69 75 73 20 50 6f 77 65 | the Rad|ius Powe|
|00001c60| 72 56 69 65 77 20 64 72 | 69 76 65 72 20 6d 6f 72 |rView dr|iver mor|
|00001c70| 65 20 6f 72 20 6c 65 73 | 73 0d 69 67 6e 6f 72 65 |e or les|s.ignore|
|00001c80| 73 20 74 68 65 20 73 65 | 74 2d 20 61 6e 64 20 67 |s the se|t- and g|
|00001c90| 65 74 2d 67 61 6d 6d 61 | 20 72 65 71 75 65 73 74 |et-gamma| request|
|00001ca0| 73 2d 2d 47 44 47 65 74 | 47 61 6d 6d 61 20 72 65 |s--GDGet|Gamma re|
|00001cb0| 74 75 72 6e 73 20 61 20 | 74 61 62 6c 65 20 74 68 |turns a |table th|
|00001cc0| 61 74 27 73 20 61 6c 6c | 0d 7a 65 72 6f 65 73 2d |at's all|.zeroes-|
|00001cd0| 2d 62 75 74 20 74 68 65 | 20 64 72 69 76 65 72 20 |-but the| driver |
|00001ce0| 66 61 69 6c 73 20 74 6f | 20 72 65 70 6f 72 74 20 |fails to| report |
|00001cf0| 61 6e 20 65 72 72 6f 72 | 2e 20 49 20 77 72 6f 74 |an error|. I wrot|
|00001d00| 65 20 74 6f 20 74 68 65 | 20 52 61 64 69 75 73 0d |e to the| Radius.|
|00001d10| 70 72 6f 67 72 61 6d 6d | 65 72 20 61 20 79 65 61 |programm|er a yea|
|00001d20| 72 20 61 67 6f 2c 20 62 | 75 74 20 74 68 65 79 27 |r ago, b|ut they'|
|00001d30| 72 65 20 6e 6f 20 6c 6f | 6e 67 65 72 20 69 6e 74 |re no lo|nger int|
|00001d40| 65 72 65 73 74 65 64 20 | 69 6e 20 77 6f 72 6b 69 |erested |in worki|
|00001d50| 6e 67 20 6f 6e 20 74 68 | 61 74 0d 70 72 6f 64 75 |ng on th|at.produ|
|00001d60| 63 74 2e 29 0d 20 20 20 | 20 20 0d 0d 50 52 4f 42 |ct.). | ..PROB|
|00001d70| 4c 45 4d 3a 0d 48 6f 77 | 20 63 61 6e 20 49 20 74 |LEM:.How| can I t|
|00001d80| 65 6c 6c 20 77 68 65 74 | 68 65 72 20 49 27 76 65 |ell whet|her I've|
|00001d90| 20 67 6f 74 20 61 20 43 | 47 72 61 66 50 74 72 20 | got a C|GrafPtr |
|00001da0| 6f 72 20 61 20 47 57 6f | 72 6c 64 50 74 72 3f 20 |or a GWo|rldPtr? |
|00001db0| 28 49 6e 20 6f 6e 65 20 | 63 61 73 65 20 49 27 6c |(In one |case I'l|
|00001dc0| 6c 20 63 61 6c 6c 20 0d | 47 65 74 47 57 6f 72 6c |l call .|GetGWorl|
|00001dd0| 64 44 65 76 69 63 65 2c | 20 69 6e 20 74 68 65 20 |dDevice,| in the |
|00001de0| 6f 74 68 65 72 20 63 61 | 73 65 20 49 27 6c 6c 20 |other ca|se I'll |
|00001df0| 67 65 74 20 6d 61 78 20 | 64 65 76 69 63 65 2e 29 |get max |device.)|
|00001e00| 0d 49 20 6e 6f 74 69 63 | 65 64 20 74 68 61 74 20 |.I notic|ed that |
|00001e10| 74 68 65 20 70 6f 72 74 | 56 65 72 73 69 6f 6e 73 |the port|Versions|
|00001e20| 20 61 72 65 20 30 78 63 | 30 30 31 20 61 6e 64 20 | are 0xc|001 and |
|00001e30| 30 78 63 30 30 30 2e 20 | 53 68 6f 75 6c 64 20 49 |0xc000. |Should I|
|00001e40| 20 75 73 65 20 74 68 61 | 74 20 74 6f 20 74 65 6c | use tha|t to tel|
|00001e50| 6c 3f 0d 0d 41 4e 53 57 | 45 52 20 46 52 4f 4d 20 |l?..ANSW|ER FROM |
|00001e60| 41 50 50 4c 45 20 44 45 | 56 53 55 50 50 4f 52 54 |APPLE DE|VSUPPORT|
|00001e70| 20 28 38 2f 39 33 29 3a | 0d 59 6f 75 20 63 61 6e | (8/93):|.You can|
|00001e80| 20 75 73 65 20 47 65 74 | 47 57 6f 72 6c 64 44 65 | use Get|GWorldDe|
|00001e90| 76 69 63 65 28 29 20 6f | 6e 20 47 57 6f 72 6c 64 |vice() o|n GWorld|
|00001ea0| 50 74 72 2c 20 47 72 61 | 66 50 6f 72 74 20 6f 72 |Ptr, Gra|fPort or|
|00001eb0| 20 43 47 72 61 66 50 6f | 72 74 2e 20 55 73 65 0d | CGrafPo|rt. Use.|
|00001ec0| 54 65 73 74 44 65 76 69 | 63 65 41 74 74 69 62 75 |TestDevi|ceAttibu|
|00001ed0| 74 65 28 29 20 74 6f 20 | 74 65 73 74 20 69 66 20 |te() to |test if |
|00001ee0| 74 68 65 20 72 65 74 75 | 72 6e 65 64 20 47 44 48 |the retu|rned GDH|
|00001ef0| 61 6e 64 6c 65 20 69 73 | 20 61 20 22 72 65 61 6c |andle is| a "real|
|00001f00| 22 20 73 63 72 65 65 6e | 20 6f 72 20 6e 6f 74 2e |" screen| or not.|
|00001f10| 0d 0d 41 6c 73 6f 2c 20 | 79 6f 75 20 73 68 6f 75 |..Also, |you shou|
|00001f20| 6c 64 20 72 65 66 65 72 | 20 74 6f 20 74 68 65 20 |ld refer| to the |
|00001f30| 74 65 63 68 20 6e 6f 74 | 65 20 d2 52 6f 77 42 79 |tech not|e .RowBy|
|00001f40| 74 65 73 20 52 65 76 65 | 61 6c 65 64 20 49 49 d3 |tes Reve|aled II.|
|00001f50| 20 28 61 76 61 69 6c 61 | 62 6c 65 20 6f 6e 20 74 | (availa|ble on t|
|00001f60| 68 65 0d 4a 75 6e 65 20 | 44 65 76 65 6c 6f 70 65 |he.June |Develope|
|00001f70| 72 20 43 44 29 20 77 68 | 69 63 68 20 73 74 61 74 |r CD) wh|ich stat|
|00001f80| 65 73 3a 0d 0d 59 6f 75 | 27 6c 6c 20 6e 6f 74 69 |es:..You|'ll noti|
|00001f90| 63 65 20 69 6e 20 46 69 | 67 75 72 65 20 31 20 74 |ce in Fi|gure 1 t|
|00001fa0| 68 61 74 20 74 68 65 20 | 70 6f 72 74 56 65 72 73 |hat the |portVers|
|00001fb0| 69 6f 6e 20 66 69 65 6c | 64 20 6f 66 20 61 20 63 |ion fiel|d of a c|
|00001fc0| 47 72 61 66 50 6f 72 74 | 20 63 6f 69 6e 63 69 64 |GrafPort| coincid|
|00001fd0| 65 73 0d 77 69 74 68 20 | 74 68 65 20 6c 6f 63 61 |es.with |the loca|
|00001fe0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 72 6f 77 42 |tion of |the rowB|
|00001ff0| 79 74 65 73 20 66 69 65 | 6c 64 20 6f 66 20 61 20 |ytes fie|ld of a |
|00002000| 67 72 61 66 50 6f 72 74 | 2e 20 52 65 6d 65 6d 62 |grafPort|. Rememb|
|00002010| 65 72 2c 20 61 20 63 47 | 72 61 66 50 6f 72 74 20 |er, a cG|rafPort |
|00002020| 68 61 73 0d 74 68 65 20 | 73 61 6d 65 20 73 69 7a |has.the |same siz|
|00002030| 65 20 61 73 20 61 20 67 | 72 61 66 50 6f 72 74 2e |e as a g|rafPort.|
|00002040| 20 44 75 72 69 6e 67 20 | 64 65 62 75 67 67 69 6e | During |debuggin|
|00002050| 67 2c 20 79 6f 75 20 63 | 61 6e 20 75 73 65 20 74 |g, you c|an use t|
|00002060| 68 65 20 73 61 6d 65 20 | 69 6e 66 6f 72 6d 61 74 |he same |informat|
|00002070| 69 6f 6e 0d 74 68 61 74 | 20 43 6f 70 79 42 69 74 |ion.that| CopyBit|
|00002080| 73 20 75 73 65 73 20 74 | 6f 20 69 64 65 6e 74 69 |s uses t|o identi|
|00002090| 66 79 20 63 47 72 61 66 | 50 6f 72 74 73 2e 0d 0d |fy cGraf|Ports...|
|000020a0| 49 66 20 79 6f 75 20 75 | 73 65 20 61 20 67 72 61 |If you u|se a gra|
|000020b0| 66 50 6f 72 74 20 74 65 | 6d 70 6c 61 74 65 20 74 |fPort te|mplate t|
|000020c0| 6f 20 64 69 73 70 6c 61 | 79 20 6d 65 6d 6f 72 79 |o displa|y memory|
|000020d0| 20 66 6f 72 20 61 6e 20 | 75 6e 6b 6e 6f 77 6e 20 | for an |unknown |
|000020e0| 67 72 61 66 50 6f 72 74 | 2c 20 79 6f 75 0d 63 61 |grafPort|, you.ca|
|000020f0| 6e 20 74 65 6c 6c 20 69 | 66 20 69 74 20 69 73 20 |n tell i|f it is |
|00002100| 61 20 63 47 72 61 66 50 | 6f 72 74 20 62 65 63 61 |a cGrafP|ort beca|
|00002110| 75 73 65 20 74 68 65 20 | 72 6f 77 42 79 74 65 73 |use the |rowBytes|
|00002120| 20 77 69 6c 6c 20 62 65 | 20 65 71 75 61 6c 20 74 | will be| equal t|
|00002130| 6f 20 30 78 43 30 30 30 | 2e 20 54 68 65 0d 30 78 |o 0xC000|. The.0x|
|00002140| 43 20 63 6f 72 72 65 73 | 70 6f 6e 64 73 20 74 6f |C corres|ponds to|
|00002150| 20 74 68 65 20 74 77 6f | 20 68 69 67 68 20 62 69 | the two| high bi|
|00002160| 74 73 20 62 65 69 6e 67 | 20 73 65 74 20 69 6e 20 |ts being| set in |
|00002170| 74 68 65 20 70 6f 72 74 | 56 65 72 73 69 6f 6e 20 |the port|Version |
|00002180| 66 69 65 6c 64 20 6f 66 | 20 61 0d 63 47 72 61 66 |field of| a.cGraf|
|00002190| 50 6f 72 74 2e 20 53 69 | 6e 63 65 20 74 68 65 73 |Port. Si|nce thes|
|000021a0| 65 20 62 69 74 73 20 63 | 61 6e 20 6e 6f 74 20 62 |e bits c|an not b|
|000021b0| 65 20 73 65 74 20 69 6e | 20 61 20 67 72 61 66 50 |e set in| a grafP|
|000021c0| 6f 72 74 2c 20 79 6f 75 | 20 6b 6e 6f 77 20 79 6f |ort, you| know yo|
|000021d0| 75 20 68 61 76 65 20 61 | 0d 63 47 72 61 66 50 6f |u have a|.cGrafPo|
|000021e0| 72 74 2e 20 49 6e 20 61 | 64 64 69 74 69 6f 6e 2c |rt. In a|ddition,|
|000021f0| 20 69 66 20 74 68 65 20 | 62 6f 74 74 6f 6d 20 62 | if the |bottom b|
|00002200| 69 74 20 6f 66 20 74 68 | 65 20 70 6f 72 74 56 65 |it of th|e portVe|
|00002210| 72 73 69 6f 6e 20 66 69 | 65 6c 64 20 69 73 20 73 |rsion fi|eld is s|
|00002220| 65 74 2c 20 74 68 65 6e | 0d 69 74 20 69 73 20 61 |et, then|.it is a|
|00002230| 20 67 57 6f 72 6c 64 2e | 20 54 68 75 73 2c 20 69 | gWorld.| Thus, i|
|00002240| 66 20 79 6f 75 72 20 72 | 6f 77 42 79 74 65 73 20 |f your r|owBytes |
|00002250| 66 69 65 6c 64 20 68 61 | 73 20 61 20 76 61 6c 75 |field ha|s a valu|
|00002260| 65 20 6f 66 20 30 78 43 | 30 30 31 2c 20 74 68 65 |e of 0xC|001, the|
|00002270| 6e 20 79 6f 75 0d 6b 6e | 6f 77 20 79 6f 75 20 68 |n you.kn|ow you h|
|00002280| 61 76 65 20 61 20 67 57 | 6f 72 6c 64 2e 0d 0d 43 |ave a gW|orld...C|
|00002290| 4f 4e 43 4c 55 53 49 4f | 4e 3a 0d 54 68 69 73 20 |ONCLUSIO|N:.This |
|000022a0| 61 64 76 69 63 65 20 69 | 73 20 69 6d 70 6c 65 6d |advice i|s implem|
|000022b0| 65 6e 74 65 64 20 69 6e | 20 74 68 65 20 72 6f 75 |ented in| the rou|
|000022c0| 74 69 6e 65 20 49 73 47 | 57 6f 72 6c 64 50 74 72 |tine IsG|WorldPtr|
|000022d0| 28 77 69 6e 64 6f 77 29 | 2e 0d 0d 48 49 53 54 4f |(window)|...HISTO|
|000022e0| 52 59 3a 0d 0d 31 32 2f | 38 38 09 09 64 67 70 09 |RY:..12/|88..dgp.|
|000022f0| 77 72 6f 74 65 20 69 74 | 0d 38 2f 35 2f 38 39 09 |wrote it|.8/5/89.|
|00002300| 09 09 61 64 64 65 64 20 | 63 61 6c 6c 20 74 6f 20 |..added |call to |
|00002310| 47 44 55 6e 63 6f 72 72 | 65 63 74 65 64 47 61 6d |GDUncorr|ectedGam|
|00002320| 6d 61 2c 20 73 6f 20 49 | 20 63 6f 75 6c 64 6e 27 |ma, so I| couldn'|
|00002330| 74 20 66 6f 72 67 65 74 | 2e 0d 38 2f 31 35 2f 38 |t forget|..8/15/8|
|00002340| 39 20 09 64 67 70 20 74 | 72 69 76 69 61 0d 33 2f |9 .dgp t|rivia.3/|
|00002350| 32 30 2f 39 30 09 09 64 | 67 70 09 6d 61 6b 65 20 |20/90..d|gp.make |
|00002360| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 20 |compatib|le with |
|00002370| 4d 50 57 20 43 2e 0d 33 | 2f 32 39 2f 39 30 09 09 |MPW C..3|/29/90..|
|00002380| 64 67 70 09 63 68 61 6e | 67 65 64 20 64 65 63 6c |dgp.chan|ged decl|
|00002390| 61 72 65 64 20 72 65 74 | 75 72 6e 65 64 20 74 79 |ared ret|urned ty|
|000023a0| 70 65 20 66 72 6f 6d 20 | 57 69 6e 64 6f 77 50 74 |pe from |WindowPt|
|000023b0| 72 20 74 6f 20 43 57 69 | 6e 64 6f 77 50 74 72 2c |r to CWi|ndowPtr,|
|000023c0| 20 77 68 69 63 68 0d 09 | 09 09 09 69 73 20 77 68 | which..|...is wh|
|000023d0| 61 74 20 69 74 27 73 20 | 72 65 61 6c 6c 79 20 62 |at it's |really b|
|000023e0| 65 65 6e 20 61 6c 6c 20 | 61 6c 6f 6e 67 2e 20 53 |een all |along. S|
|000023f0| 61 6d 65 20 63 68 61 6e | 67 65 20 74 6f 20 61 72 |ame chan|ge to ar|
|00002400| 67 75 6d 65 6e 74 20 6f | 66 0d 09 09 09 09 47 44 |gument o|f.....GD|
|00002410| 44 69 73 70 6f 73 65 57 | 69 6e 64 6f 77 28 29 2e |DisposeW|indow().|
|00002420| 20 54 68 65 20 6e 65 77 | 20 6f 66 66 73 63 72 65 | The new| offscre|
|00002430| 65 6e 20 47 57 6f 72 6c | 64 20 63 61 6c 6c 73 20 |en GWorl|d calls |
|00002440| 66 6f 72 20 74 68 65 20 | 66 69 72 73 74 20 74 69 |for the |first ti|
|00002450| 6d 65 0d 09 09 09 09 6d | 61 6b 65 20 69 74 20 65 |me.....m|ake it e|
|00002460| 61 73 69 65 72 20 74 6f | 20 68 6f 6e 65 73 74 6c |asier to| honestl|
|00002470| 79 20 64 65 63 6c 61 72 | 65 20 6f 6e 65 27 73 20 |y declar|e one's |
|00002480| 77 69 6e 64 6f 77 73 20 | 61 73 20 63 6f 6c 6f 72 |windows |as color|
|00002490| 20 72 61 74 68 65 72 0d | 09 09 09 09 74 68 61 6e | rather.|....than|
|000024a0| 20 70 72 65 74 65 6e 64 | 69 6e 67 20 74 68 65 79 | pretend|ing they|
|000024b0| 27 72 65 20 6e 6f 74 2e | 0d 38 2f 32 34 2f 39 31 |'re not.|.8/24/91|
|000024c0| 09 09 64 67 70 09 4d 61 | 64 65 20 63 6f 6d 70 61 |..dgp.Ma|de compa|
|000024d0| 74 69 62 6c 65 20 77 69 | 74 68 20 54 48 49 4e 4b |tible wi|th THINK|
|000024e0| 20 43 20 35 2e 30 2e 0d | 32 2f 31 2f 39 32 09 09 | C 5.0..|2/1/92..|
|000024f0| 64 67 70 20 4d 61 64 65 | 20 6f 70 74 69 6f 6e 61 |dgp Made| optiona|
|00002500| 6c 20 74 68 65 20 64 65 | 76 69 63 65 20 61 72 67 |l the de|vice arg|
|00002510| 75 6d 65 6e 74 20 74 6f | 20 47 44 44 69 73 70 6f |ument to| GDDispo|
|00002520| 73 65 57 69 6e 64 6f 77 | 28 29 2e 20 49 66 20 69 |seWindow|(). If i|
|00002530| 74 27 73 0d 09 09 09 09 | 4e 55 4c 4c 2c 20 74 68 |t's.....|NULL, th|
|00002540| 65 6e 20 69 74 20 77 69 | 6c 6c 20 62 65 20 64 65 |en it wi|ll be de|
|00002550| 74 65 72 6d 69 6e 65 64 | 20 61 75 74 6f 6d 61 74 |termined| automat|
|00002560| 69 63 61 6c 6c 79 20 66 | 72 6f 6d 20 77 69 6e 64 |ically f|rom wind|
|00002570| 6f 77 2e 0d 32 2f 33 2f | 39 33 09 09 64 68 62 09 |ow..2/3/|93..dhb.|
|00002580| 45 78 74 72 61 63 74 65 | 64 20 41 64 64 45 78 70 |Extracte|d AddExp|
|00002590| 6c 69 63 69 74 50 61 6c | 65 74 74 65 20 66 72 6f |licitPal|ette fro|
|000025a0| 6d 20 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 2e 0d |m GDOpen|Window..|
|000025b0| 32 2f 32 31 2f 39 33 09 | 09 64 67 70 09 48 69 64 |2/21/93.|.dgp.Hid|
|000025c0| 65 4d 65 6e 75 42 61 72 | 20 69 66 20 77 69 6e 64 |eMenuBar| if wind|
|000025d0| 6f 77 20 69 73 20 6f 6e | 20 6d 61 69 6e 20 73 63 |ow is on| main sc|
|000025e0| 72 65 65 6e 2e 0d 32 2f | 32 33 2f 39 33 09 09 64 |reen..2/|23/93..d|
|000025f0| 67 70 20 41 64 64 45 78 | 70 6c 69 63 69 74 50 61 |gp AddEx|plicitPa|
|00002600| 6c 65 74 74 65 28 29 20 | 72 65 74 75 72 6e 73 20 |lette() |returns |
|00002610| 69 6d 6d 65 64 69 61 74 | 65 6c 79 20 75 6e 6c 65 |immediat|ely unle|
|00002620| 73 73 20 69 74 20 72 65 | 63 65 69 76 65 73 20 61 |ss it re|ceives a|
|00002630| 20 63 6f 6c 6f 72 20 0d | 09 09 09 09 77 69 6e 64 | color .|....wind|
|00002640| 6f 77 2e 0d 09 09 09 09 | 41 64 64 65 64 20 47 44 |ow......|Added GD|
|00002650| 4f 70 65 6e 57 69 6e 64 | 6f 77 31 28 29 20 61 6e |OpenWind|ow1() an|
|00002660| 64 20 47 44 44 69 73 70 | 6f 73 65 57 69 6e 64 6f |d GDDisp|oseWindo|
|00002670| 77 31 28 29 2c 20 77 68 | 69 63 68 20 62 6f 74 68 |w1(), wh|ich both|
|00002680| 20 75 73 65 0d 09 09 09 | 09 61 20 57 69 6e 64 6f | use....|.a Windo|
|00002690| 77 50 74 72 2c 20 69 6e | 73 74 65 61 64 20 6f 66 |wPtr, in|stead of|
|000026a0| 20 61 20 6c 65 73 73 20 | 63 6f 6e 76 65 6e 69 65 | a less |convenie|
|000026b0| 6e 74 20 43 57 69 6e 64 | 6f 77 50 74 72 2e 0d 33 |nt CWind|owPtr..3|
|000026c0| 2f 35 2f 39 33 09 09 64 | 67 70 09 41 64 64 65 64 |/5/93..d|gp.Added|
|000026d0| 20 63 61 6c 6c 73 20 74 | 6f 20 55 6e 63 6c 69 70 | calls t|o Unclip|
|000026e0| 53 63 72 65 65 6e 28 29 | 20 61 6e 64 20 52 65 73 |Screen()| and Res|
|000026f0| 74 6f 72 65 53 63 72 65 | 65 6e 43 6c 69 70 70 69 |toreScre|enClippi|
|00002700| 6e 67 28 29 2c 20 73 6f | 20 74 68 65 20 77 69 6e |ng(), so| the win|
|00002710| 64 6f 77 0d 09 09 09 09 | 6e 6f 77 20 74 72 75 6c |dow.....|now trul|
|00002720| 79 20 66 69 6c 6c 73 20 | 74 68 65 20 77 68 6f 6c |y fills |the whol|
|00002730| 65 20 73 63 72 65 65 6e | 2e 20 45 64 69 74 65 64 |e screen|. Edited|
|00002740| 20 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 28 29 20 | GDOpenW|indow() |
|00002750| 66 6f 72 20 63 6c 61 72 | 69 74 79 2e 0d 33 2f 37 |for clar|ity..3/7|
|00002760| 2f 38 33 09 09 64 67 70 | 09 41 64 64 65 64 20 63 |/83..dgp|.Added c|
|00002770| 61 6c 6c 73 20 74 6f 20 | 47 44 53 61 76 65 47 61 |alls to |GDSaveGa|
|00002780| 6d 6d 61 28 64 65 76 69 | 63 65 29 20 61 6e 64 20 |mma(devi|ce) and |
|00002790| 47 44 52 65 73 74 6f 72 | 65 47 61 6d 6d 61 28 64 |GDRestor|eGamma(d|
|000027a0| 65 76 69 63 65 29 2e 0d | 34 2f 31 36 2f 39 33 09 |evice)..|4/16/93.|
|000027b0| 09 64 67 70 09 43 6f 73 | 6d 65 74 69 63 20 65 64 |.dgp.Cos|metic ed|
|000027c0| 69 74 69 6e 67 2e 0d 35 | 2f 32 32 2f 39 33 09 09 |iting..5|/22/93..|
|000027d0| 64 67 70 09 41 64 64 65 | 64 20 52 65 6d 6f 76 65 |dgp.Adde|d Remove|
|000027e0| 50 61 6c 65 74 74 65 28 | 29 2c 20 62 75 74 20 64 |Palette(|), but d|
|000027f0| 69 64 6e 27 74 20 74 65 | 73 74 20 69 74 2e 0d 31 |idn't te|st it..1|
|00002800| 2f 32 37 2f 39 34 09 09 | 64 67 70 09 43 6f 73 6d |/27/94..|dgp.Cosm|
|00002810| 65 74 69 63 20 65 64 69 | 74 69 6e 67 2e 0d 33 2f |etic edi|ting..3/|
|00002820| 35 2f 39 34 09 09 64 67 | 70 09 44 65 63 69 64 65 |5/94..dg|p.Decide|
|00002830| 64 20 74 68 61 74 20 52 | 65 6d 6f 76 65 50 61 6c |d that R|emovePal|
|00002840| 65 74 74 65 28 29 20 77 | 6f 72 6b 73 20 66 69 6e |ette() w|orks fin|
|00002850| 65 20 6e 6f 77 2e 0d 36 | 2f 38 2f 39 34 09 09 64 |e now..6|/8/94..d|
|00002860| 67 70 20 41 64 64 45 78 | 70 6c 69 63 69 74 50 61 |gp AddEx|plicitPa|
|00002870| 6c 65 74 74 65 20 6e 6f | 77 20 63 61 6c 6c 73 20 |lette no|w calls |
|00002880| 74 68 65 20 6e 65 77 20 | 4d 61 6b 65 43 6f 6c 6f |the new |MakeColo|
|00002890| 72 54 61 62 6c 65 45 78 | 70 6c 69 63 69 74 28 29 |rTableEx|plicit()|
|000028a0| 2c 20 77 68 69 63 68 0d | 09 09 09 09 73 65 74 73 |, which.|....sets|
|000028b0| 20 74 68 65 20 43 6f 6c | 6f 72 20 54 61 62 6c 65 | the Col|or Table|
|000028c0| 20 63 74 46 6c 61 67 73 | 20 74 6f 20 69 6e 64 69 | ctFlags| to indi|
|000028d0| 63 61 74 65 20 74 68 61 | 74 0d 09 09 09 09 74 68 |cate tha|t.....th|
|000028e0| 65 20 43 6f 6c 6f 72 20 | 54 61 62 6c 65 20 72 65 |e Color |Table re|
|000028f0| 66 65 72 73 20 65 78 70 | 6c 69 63 69 74 6c 79 0d |fers exp|licitly.|
|00002900| 09 09 09 09 74 6f 20 74 | 68 65 20 65 78 70 6c 69 |....to t|he expli|
|00002910| 63 69 74 20 70 61 6c 65 | 74 74 65 2e 20 54 68 69 |cit pale|tte. Thi|
|00002920| 73 20 74 65 6c 6c 73 20 | 43 6f 70 79 42 69 74 73 |s tells |CopyBits|
|00002930| 20 74 6f 20 74 72 65 61 | 74 0d 09 09 09 09 74 68 | to trea|t.....th|
|00002940| 65 20 70 69 78 65 6c 73 | 20 61 73 20 6e 75 6d 62 |e pixels| as numb|
|00002950| 65 72 73 2c 20 6e 6f 74 | 20 69 6e 64 69 63 65 73 |ers, not| indices|
|00002960| 2e 0d 36 2f 31 33 2f 39 | 34 09 09 64 67 70 20 49 |..6/13/9|4..dgp I|
|00002970| 6e 20 72 65 73 70 6f 6e | 73 65 20 74 6f 20 71 75 |n respon|se to qu|
|00002980| 65 72 79 20 62 79 20 44 | 61 76 69 64 20 42 72 61 |ery by D|avid Bra|
|00002990| 69 6e 61 72 64 20 49 20 | 6e 6f 77 20 64 6f 63 75 |inard I |now docu|
|000029a0| 6d 65 6e 74 20 61 62 6f | 76 65 0d 09 09 09 09 74 |ment abo|ve.....t|
|000029b0| 68 65 20 6f 62 73 63 75 | 72 65 20 66 61 63 74 20 |he obscu|re fact |
|000029c0| 74 68 61 74 20 47 44 4f | 70 65 6e 57 69 6e 64 6f |that GDO|penWindo|
|000029d0| 77 27 73 20 66 72 61 6d | 65 20 77 69 6c 6c 20 61 |w's fram|e will a|
|000029e0| 70 70 65 61 72 20 6f 6e | 0d 09 09 09 09 6f 74 68 |ppear on|.....oth|
|000029f0| 65 72 20 73 63 72 65 65 | 6e 73 20 74 68 61 74 20 |er scree|ns that |
|00002a00| 61 72 65 20 63 6f 6e 74 | 69 67 75 6f 75 73 20 70 |are cont|iguous p|
|00002a10| 61 72 74 73 20 6f 66 20 | 74 68 65 20 64 65 73 6b |arts of |the desk|
|00002a20| 74 6f 70 2e 0d 38 2f 31 | 31 2f 39 34 20 64 68 62 |top..8/1|1/94 dhb|
|00002a30| 20 26 20 64 67 70 20 44 | 61 76 69 64 20 42 72 61 | & dgp D|avid Bra|
|00002a40| 69 6e 61 72 64 20 64 69 | 73 63 6f 76 65 72 65 64 |inard di|scovered|
|00002a50| 20 74 68 61 74 20 4d 61 | 6b 65 43 6f 6c 6f 72 54 | that Ma|keColorT|
|00002a60| 61 62 6c 65 45 78 70 6c | 69 63 69 74 28 29 2c 20 |ableExpl|icit(), |
|00002a70| 77 68 69 63 68 0d 09 09 | 09 09 69 73 20 63 61 6c |which...|..is cal|
|00002a80| 6c 65 64 20 62 79 20 41 | 64 64 45 78 70 6c 69 63 |led by A|ddExplic|
|00002a90| 69 74 50 61 6c 65 74 74 | 65 2c 20 77 68 69 63 68 |itPalett|e, which|
|00002aa0| 20 69 73 20 63 61 6c 6c | 65 64 20 62 79 20 47 44 | is call|ed by GD|
|00002ab0| 4f 70 65 6e 57 69 6e 64 | 6f 77 31 2c 20 77 61 73 |OpenWind|ow1, was|
|00002ac0| 20 61 66 66 65 63 74 69 | 6e 67 0d 09 09 09 09 6e | affecti|ng.....n|
|00002ad0| 6f 74 20 6a 75 73 74 20 | 74 68 65 20 6e 65 77 20 |ot just |the new |
|00002ae0| 77 69 6e 64 6f 77 27 73 | 20 63 6f 6c 6f 72 20 74 |window's| color t|
|00002af0| 61 62 6c 65 2c 20 62 75 | 74 20 77 61 73 20 61 6c |able, bu|t was al|
|00002b00| 73 6f 20 61 66 66 65 63 | 74 69 6e 67 20 74 68 65 |so affec|ting the|
|00002b10| 20 64 65 76 69 63 65 27 | 73 20 63 6f 6c 6f 72 0d | device'|s color.|
|00002b20| 09 09 09 09 74 61 62 6c | 65 20 28 62 65 63 61 75 |....tabl|e (becau|
|00002b30| 73 65 20 74 68 65 79 20 | 73 68 61 72 65 20 74 68 |se they |share th|
|00002b40| 65 20 73 61 6d 65 20 63 | 6f 6c 6f 72 20 74 61 62 |e same c|olor tab|
|00002b50| 6c 65 29 2c 20 61 6e 64 | 20 74 68 61 74 20 74 68 |le), and| that th|
|00002b60| 65 20 64 65 76 69 63 65 | 27 73 20 63 6f 6c 6f 72 |e device|'s color|
|00002b70| 0d 09 09 09 09 74 61 62 | 6c 65 20 77 61 73 20 6e |.....tab|le was n|
|00002b80| 6f 74 20 72 65 73 74 6f | 72 65 64 2e 20 22 54 68 |ot resto|red. "Th|
|00002b90| 65 20 73 79 6d 70 74 6f | 6d 20 69 73 20 74 68 61 |e sympto|m is tha|
|00002ba0| 74 20 69 66 20 79 6f 75 | 20 73 75 62 73 65 71 75 |t if you| subsequ|
|00002bb0| 65 6e 74 6c 79 20 6c 61 | 75 6e 63 68 0d 09 09 09 |ently la|unch....|
|00002bc0| 09 4d 69 63 72 6f 73 6f | 66 74 20 57 6f 72 64 2c |.Microso|ft Word,|
|00002bd0| 20 74 68 65 20 62 61 63 | 6b 67 72 6f 75 6e 64 20 | the bac|kground |
|00002be0| 6f 66 20 74 68 65 20 74 | 65 78 74 20 77 69 6e 64 |of the t|ext wind|
|00002bf0| 6f 77 20 74 61 6b 65 73 | 20 6f 6e 20 61 20 73 74 |ow takes| on a st|
|00002c00| 72 61 6e 67 65 20 63 6f | 6c 6f 72 0d 09 09 09 09 |range co|lor.....|
|00002c10| 28 67 72 65 79 29 20 69 | 6e 20 72 65 67 69 6f 6e |(grey) i|n region|
|00002c20| 73 20 77 68 65 72 65 20 | 74 68 65 72 65 20 69 73 |s where |there is|
|00002c30| 20 74 65 78 74 2c 22 20 | 61 6e 64 20 74 68 65 20 | text," |and the |
|00002c40| 70 72 6f 62 6c 65 6d 20 | 70 65 72 73 69 73 74 73 |problem |persists|
|00002c50| 20 75 6e 74 69 6c 20 72 | 65 62 6f 6f 74 2e 0d 09 | until r|eboot...|
|00002c60| 09 09 09 54 68 65 20 73 | 6f 6c 75 74 69 6f 6e 20 |...The s|olution |
|00002c70| 69 73 20 74 6f 20 67 69 | 76 65 20 6f 75 72 20 77 |is to gi|ve our w|
|00002c80| 69 6e 64 6f 77 20 69 74 | 73 20 6f 77 6e 20 63 6f |indow it|s own co|
|00002c90| 6c 6f 72 20 74 61 62 6c | 65 2c 20 77 68 69 63 68 |lor tabl|e, which|
|00002ca0| 20 77 65 20 63 61 6e 0d | 09 09 09 09 73 61 66 65 | we can.|....safe|
|00002cb0| 6c 79 20 6d 6f 64 69 66 | 79 2e 20 0d 38 2f 31 32 |ly modif|y. .8/12|
|00002cc0| 2f 39 34 20 64 68 62 20 | 26 20 64 67 70 20 6f 6e |/94 dhb |& dgp on|
|00002cd0| 20 38 2f 31 31 20 64 65 | 6e 69 73 20 69 6e 61 64 | 8/11 de|nis inad|
|00002ce0| 76 65 72 74 65 6e 74 6c | 79 20 69 6e 74 72 6f 64 |vertentl|y introd|
|00002cf0| 75 63 65 64 20 61 20 62 | 75 67 20 69 6e 74 6f 20 |uced a b|ug into |
|00002d00| 47 44 44 69 73 70 6f 73 | 65 57 69 6e 64 6f 77 31 |GDDispos|eWindow1|
|00002d10| 2c 20 0d 09 09 09 09 6d | 6f 76 69 6e 67 20 74 68 |, .....m|oving th|
|00002d20| 65 20 63 61 6c 6c 20 74 | 6f 20 47 65 74 57 69 6e |e call t|o GetWin|
|00002d30| 64 6f 77 44 65 76 69 63 | 65 28 29 20 74 6f 20 61 |dowDevic|e() to a|
|00002d40| 20 70 6f 69 6e 74 20 61 | 66 74 65 72 20 74 68 65 | point a|fter the|
|00002d50| 20 77 69 6e 64 6f 77 0d | 09 09 09 09 77 61 73 20 | window.|....was |
|00002d60| 64 69 73 70 6f 73 65 64 | 20 6f 66 2e 20 44 61 76 |disposed| of. Dav|
|00002d70| 69 64 20 66 69 78 65 64 | 20 69 74 2c 20 6d 6f 76 |id fixed| it, mov|
|00002d80| 69 6e 67 20 74 68 65 20 | 63 61 6c 6c 20 62 61 63 |ing the |call bac|
|00002d90| 6b 20 77 68 65 72 65 20 | 69 74 20 62 65 6c 6f 6e |k where |it belon|
|00002da0| 67 65 64 2e 0d 38 2f 31 | 34 2f 39 34 09 64 67 70 |ged..8/1|4/94.dgp|
|00002db0| 09 09 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 31 20 |..GDOpen|Window1 |
|00002dc0| 6e 6f 77 20 67 65 74 73 | 20 74 68 65 20 63 6f 6c |now gets| the col|
|00002dd0| 6f 72 20 74 61 62 6c 65 | 20 66 72 6f 6d 20 74 68 |or table| from th|
|00002de0| 65 20 77 69 6e 64 6f 77 | 27 73 20 64 65 76 69 63 |e window|'s devic|
|00002df0| 65 20 69 6e 73 74 65 61 | 64 0d 09 09 09 09 6f 66 |e instea|d.....of|
|00002e00| 20 74 68 65 20 6d 61 69 | 6e 20 64 65 76 69 63 65 | the mai|n device|
|00002e10| 2e 0d 38 2f 31 37 2f 39 | 34 09 09 64 67 70 20 6d |..8/17/9|4..dgp m|
|00002e20| 61 6b 65 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |ake colo|r table |
|00002e30| 4e 4f 54 20 65 78 70 6c | 69 63 69 74 20 77 68 65 |NOT expl|icit whe|
|00002e40| 6e 20 47 44 44 69 73 70 | 6f 73 65 57 69 6e 64 6f |n GDDisp|oseWindo|
|00002e50| 77 31 20 69 73 20 63 61 | 6c 6c 65 64 2e 0d 39 2f |w1 is ca|lled..9/|
|00002e60| 35 2f 39 34 20 09 09 64 | 67 70 20 72 65 6d 6f 76 |5/94 ..d|gp remov|
|00002e70| 65 64 20 61 73 73 75 6d | 70 74 69 6f 6e 20 69 6e |ed assum|ption in|
|00002e80| 20 70 72 69 6e 74 66 27 | 73 20 74 68 61 74 20 69 | printf'|s that i|
|00002e90| 6e 74 3d 3d 73 68 6f 72 | 74 2e 0d 31 30 2f 31 30 |nt==shor|t..10/10|
|00002ea0| 2f 39 34 09 09 64 67 70 | 20 47 44 4f 70 65 6e 57 |/94..dgp| GDOpenW|
|00002eb0| 69 6e 64 6f 77 31 20 6e | 6f 77 20 61 73 73 6f 63 |indow1 n|ow assoc|
|00002ec0| 69 61 74 65 73 20 63 6f | 72 72 65 63 74 20 64 65 |iates co|rrect de|
|00002ed0| 76 69 63 65 27 73 20 63 | 6f 6c 6f 72 20 74 61 62 |vice's c|olor tab|
|00002ee0| 6c 65 20 77 69 74 68 20 | 77 69 6e 64 6f 77 2c 0d |le with |window,.|
|00002ef0| 09 09 09 09 6e 6f 74 20 | 4d 61 69 6e 44 65 76 69 |....not |MainDevi|
|00002f00| 63 65 27 73 2e 0d 31 30 | 2f 32 34 2f 39 34 09 64 |ce's..10|/24/94.d|
|00002f10| 67 70 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 31 |gp GDOpe|nWindow1|
|00002f20| 20 72 65 74 75 72 6e 73 | 20 4e 55 4c 4c 20 69 66 | returns| NULL if|
|00002f30| 20 74 68 65 72 65 27 73 | 20 6e 6f 20 64 72 69 76 | there's| no driv|
|00002f40| 65 72 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |er assoc|iated wi|
|00002f50| 74 68 20 74 68 65 20 64 | 65 76 69 63 65 2e 0d 31 |th the d|evice..1|
|00002f60| 30 2f 32 35 2f 39 34 09 | 64 67 70 20 41 64 64 65 |0/25/94.|dgp Adde|
|00002f70| 64 20 47 44 47 72 61 79 | 43 6f 6c 6f 72 54 61 62 |d GDGray|ColorTab|
|00002f80| 6c 65 28 64 65 76 69 63 | 65 29 2c 20 77 68 69 63 |le(devic|e), whic|
|00002f90| 68 20 67 69 76 65 73 20 | 74 68 65 20 64 65 76 69 |h gives |the devi|
|00002fa0| 63 65 20 61 20 73 74 61 | 6e 64 61 72 64 20 67 72 |ce a sta|ndard gr|
|00002fb0| 61 79 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 2e 0d |ay color| table..|
|00002fc0| 31 31 2f 32 2f 39 34 09 | 09 64 67 70 20 4c 65 61 |11/2/94.|.dgp Lea|
|00002fd0| 76 65 20 74 68 65 20 65 | 78 70 6c 69 63 69 74 20 |ve the e|xplicit |
|00002fe0| 62 69 74 20 61 6c 6f 6e | 65 2e 20 46 6f 72 20 74 |bit alon|e. For t|
|00002ff0| 68 65 20 61 64 76 65 6e | 74 75 72 6f 75 73 20 49 |he adven|turous I|
|00003000| 20 70 72 6f 76 69 64 65 | 20 74 68 65 20 0d 09 09 | provide| the ...|
|00003010| 09 09 4d 61 6b 65 43 6f | 6c 6f 72 54 61 62 6c 65 |..MakeCo|lorTable|
|00003020| 45 78 70 6c 69 63 69 74 | 28 29 20 72 6f 75 74 69 |Explicit|() routi|
|00003030| 6e 65 20 61 6e 64 20 64 | 6f 63 75 6d 65 6e 74 61 |ne and d|ocumenta|
|00003040| 74 69 6f 6e 20 69 6e 20 | 0d 09 09 09 09 56 69 64 |tion in |.....Vid|
|00003050| 65 6f 54 6f 6f 6c 62 6f | 78 3a 4e 6f 74 65 73 3a |eoToolbo|x:Notes:|
|00003060| 22 43 6f 70 79 42 69 74 | 73 20 73 6c 61 76 69 73 |"CopyBit|s slavis|
|00003070| 68 6c 79 22 2e 0d 31 31 | 2f 31 37 2f 39 34 09 64 |hly"..11|/17/94.d|
|00003080| 67 70 09 72 65 6e 61 6d | 65 64 20 49 73 57 69 6e |gp.renam|ed IsWin|
|00003090| 64 6f 77 20 74 6f 20 49 | 73 47 72 61 66 50 74 72 |dow to I|sGrafPtr|
|000030a0| 2e 20 52 65 6e 61 6d 65 | 64 20 49 73 4f 66 66 53 |. Rename|d IsOffS|
|000030b0| 63 72 65 65 6e 20 74 6f | 20 49 73 47 57 6f 72 6c |creen to| IsGWorl|
|000030c0| 64 50 74 72 2e 0d 34 2f | 31 31 2f 39 35 09 09 64 |dPtr..4/|11/95..d|
|000030d0| 67 70 20 46 69 78 65 64 | 20 61 73 73 65 72 74 69 |gp Fixed| asserti|
|000030e0| 6f 6e 20 66 61 69 6c 75 | 72 65 20 69 6e 20 47 44 |on failu|re in GD|
|000030f0| 47 72 61 79 57 69 6e 64 | 6f 77 3b 20 74 68 65 20 |GrayWind|ow; the |
|00003100| 72 73 72 63 20 69 64 20 | 6f 66 20 74 68 65 20 32 |rsrc id |of the 2|
|00003110| 2d 62 69 74 20 67 72 61 | 79 20 72 61 6d 70 20 69 |-bit gra|y ramp i|
|00003120| 73 20 32 2c 0d 09 09 09 | 09 6e 6f 74 20 33 32 2b |s 2,....|.not 32+|
|00003130| 32 2e 0d 34 2f 31 31 2f | 39 35 09 64 67 70 09 09 |2..4/11/|95.dgp..|
|00003140| 74 72 61 6e 73 66 65 72 | 72 65 64 20 73 6f 6d 65 |transfer|red some|
|00003150| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 20 6f | documen|tation o|
|00003160| 66 20 49 73 47 57 6f 72 | 6c 64 50 74 72 20 66 72 |f IsGWor|ldPtr fr|
|00003170| 6f 6d 20 47 65 74 53 63 | 72 65 65 6e 44 65 76 69 |om GetSc|reenDevi|
|00003180| 63 65 2e 63 20 74 6f 20 | 61 62 6f 76 65 2e 0d 33 |ce.c to |above..3|
|00003190| 2f 38 2f 39 35 09 64 67 | 70 09 09 47 44 4f 70 65 |/8/95.dg|p..GDOpe|
|000031a0| 6e 57 69 6e 64 6f 77 31 | 28 29 27 73 20 63 61 6c |nWindow1|()'s cal|
|000031b0| 6c 20 74 6f 20 47 44 47 | 72 61 79 43 6f 6c 6f 72 |l to GDG|rayColor|
|000031c0| 54 61 62 6c 65 28 29 20 | 63 61 75 73 65 73 20 74 |Table() |causes t|
|000031d0| 68 65 20 0d 09 09 09 77 | 69 6e 64 6f 77 20 66 72 |he ....w|indow fr|
|000031e0| 61 6d 65 20 74 6f 20 62 | 65 63 6f 6d 65 20 6f 72 |ame to b|ecome or|
|000031f0| 61 6e 67 65 2e 20 49 20 | 64 6f 6e 27 74 20 75 6e |ange. I |don't un|
|00003200| 64 65 72 73 74 61 6e 64 | 20 77 68 79 2c 20 62 75 |derstand| why, bu|
|00003210| 74 20 69 74 27 73 20 6f | 6e 6c 79 20 61 20 63 6f |t it's o|nly a co|
|00003220| 73 6d 65 74 69 63 20 62 | 75 67 2c 20 0d 09 09 09 |smetic b|ug, ....|
|00003230| 73 6f 20 69 27 6d 20 69 | 67 6e 6f 72 69 6e 67 20 |so i'm i|gnoring |
|00003240| 69 74 20 66 6f 72 20 74 | 68 65 20 6d 6f 6d 65 6e |it for t|he momen|
|00003250| 74 2e 0d 2a 2f 0d 23 69 | 6e 63 6c 75 64 65 20 22 |t..*/.#i|nclude "|
|00003260| 56 69 64 65 6f 54 6f 6f | 6c 62 6f 78 2e 68 22 0d |VideoToo|lbox.h".|
|00003270| 0d 23 64 65 66 69 6e 65 | 20 4d 41 4b 45 5f 43 4f |.#define| MAKE_CO|
|00003280| 4c 4f 52 5f 54 41 42 4c | 45 20 30 0d 0d 57 69 6e |LOR_TABL|E 0..Win|
|00003290| 64 6f 77 50 74 72 20 47 | 44 4f 70 65 6e 57 69 6e |dowPtr G|DOpenWin|
|000032a0| 64 6f 77 31 28 47 44 48 | 61 6e 64 6c 65 20 64 65 |dow1(GDH|andle de|
|000032b0| 76 69 63 65 29 0d 7b 0d | 09 72 65 74 75 72 6e 20 |vice).{.|.return |
|000032c0| 28 57 69 6e 64 6f 77 50 | 74 72 29 47 44 4f 70 65 |(WindowP|tr)GDOpe|
|000032d0| 6e 57 69 6e 64 6f 77 28 | 64 65 76 69 63 65 29 3b |nWindow(|device);|
|000032e0| 0d 7d 0d 0d 76 6f 69 64 | 20 47 44 44 69 73 70 6f |.}..void| GDDispo|
|000032f0| 73 65 57 69 6e 64 6f 77 | 31 28 57 69 6e 64 6f 77 |seWindow|1(Window|
|00003300| 50 74 72 20 77 69 6e 64 | 6f 77 29 0d 7b 0d 09 47 |Ptr wind|ow).{..G|
|00003310| 44 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 28 28 |DDispose|Window((|
|00003320| 43 57 69 6e 64 6f 77 50 | 74 72 29 20 77 69 6e 64 |CWindowP|tr) wind|
|00003330| 6f 77 29 3b 0d 7d 0d 0d | 43 57 69 6e 64 6f 77 50 |ow);.}..|CWindowP|
|00003340| 74 72 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 28 |tr GDOpe|nWindow(|
|00003350| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 29 |GDHandle| device)|
|00003360| 0d 7b 0d 09 43 57 69 6e | 64 6f 77 50 74 72 20 77 |.{..CWin|dowPtr w|
|00003370| 69 6e 64 6f 77 3b 0d 09 | 52 65 63 74 20 72 3b 0d |indow;..|Rect r;.|
|00003380| 09 47 44 48 61 6e 64 6c | 65 20 6f 6c 64 44 65 76 |.GDHandl|e oldDev|
|00003390| 69 63 65 3b 0d 0d 09 69 | 66 28 64 65 76 69 63 65 |ice;...i|f(device|
|000033a0| 3d 3d 4e 55 4c 4c 20 7c | 7c 20 28 2a 64 65 76 69 |==NULL ||| (*devi|
|000033b0| 63 65 29 2d 3e 67 64 52 | 65 66 4e 75 6d 3d 3d 30 |ce)->gdR|efNum==0|
|000033c0| 29 72 65 74 75 72 6e 20 | 4e 55 4c 4c 3b 0d 09 72 |)return |NULL;..r|
|000033d0| 3d 28 2a 64 65 76 69 63 | 65 29 2d 3e 67 64 52 65 |=(*devic|e)->gdRe|
|000033e0| 63 74 3b 09 09 2f 2f 20 | 72 65 63 74 20 6f 66 20 |ct;..// |rect of |
|000033f0| 64 65 73 69 72 65 64 20 | 73 63 72 65 65 6e 20 69 |desired |screen i|
|00003400| 6e 20 67 6c 6f 62 61 6c | 20 63 6f 6f 72 64 69 6e |n global| coordin|
|00003410| 61 74 65 73 0d 09 47 44 | 53 61 76 65 47 61 6d 6d |ates..GD|SaveGamm|
|00003420| 61 28 64 65 76 69 63 65 | 29 3b 0d 09 47 44 55 6e |a(device|);..GDUn|
|00003430| 63 6f 72 72 65 63 74 65 | 64 47 61 6d 6d 61 28 64 |correcte|dGamma(d|
|00003440| 65 76 69 63 65 29 3b 0d | 09 55 6e 63 6c 69 70 53 |evice);.|.UnclipS|
|00003450| 63 72 65 65 6e 28 64 65 | 76 69 63 65 29 3b 0d 09 |creen(de|vice);..|
|00003460| 47 44 47 72 61 79 43 6f | 6c 6f 72 54 61 62 6c 65 |GDGrayCo|lorTable|
|00003470| 28 64 65 76 69 63 65 29 | 3b 0d 09 6f 6c 64 44 65 |(device)|;..oldDe|
|00003480| 76 69 63 65 3d 47 65 74 | 47 44 65 76 69 63 65 28 |vice=Get|GDevice(|
|00003490| 29 3b 0d 09 53 65 74 47 | 44 65 76 69 63 65 28 47 |);..SetG|Device(G|
|000034a0| 65 74 4d 61 69 6e 44 65 | 76 69 63 65 28 29 29 3b |etMainDe|vice());|
|000034b0| 09 2f 2f 20 4e 65 65 64 | 65 64 20 66 6f 72 20 77 |.// Need|ed for w|
|000034c0| 69 6e 64 6f 77 20 74 6f | 20 77 6f 72 6b 20 70 72 |indow to| work pr|
|000034d0| 6f 70 65 72 6c 79 2e 0d | 09 77 69 6e 64 6f 77 3d |operly..|.window=|
|000034e0| 28 43 57 69 6e 64 6f 77 | 50 74 72 29 4e 65 77 43 |(CWindow|Ptr)NewC|
|000034f0| 57 69 6e 64 6f 77 28 4e | 55 4c 4c 2c 26 72 2c 22 |Window(N|ULL,&r,"|
|00003500| 5c 70 22 2c 54 52 55 45 | 2c 70 6c 61 69 6e 44 42 |\p",TRUE|,plainDB|
|00003510| 6f 78 2c 28 57 69 6e 64 | 6f 77 50 74 72 29 20 2d |ox,(Wind|owPtr) -|
|00003520| 31 4c 2c 30 2c 31 32 33 | 4c 29 3b 0d 09 28 2a 77 |1L,0,123|L);..(*w|
|00003530| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 50 69 78 4d 61 |indow->p|ortPixMa|
|00003540| 70 29 2d 3e 70 6d 54 61 | 62 6c 65 3d 28 2a 2a 28 |p)->pmTa|ble=(**(|
|00003550| 2a 2a 64 65 76 69 63 65 | 29 2e 67 64 50 4d 61 70 |**device|).gdPMap|
|00003560| 29 2e 70 6d 54 61 62 6c | 65 3b 0d 09 53 65 74 47 |).pmTabl|e;..SetG|
|00003570| 44 65 76 69 63 65 28 6f | 6c 64 44 65 76 69 63 65 |Device(o|ldDevice|
|00003580| 29 3b 0d 09 41 64 64 45 | 78 70 6c 69 63 69 74 50 |);..AddE|xplicitP|
|00003590| 61 6c 65 74 74 65 28 28 | 57 69 6e 64 6f 77 50 74 |alette((|WindowPt|
|000035a0| 72 29 77 69 6e 64 6f 77 | 29 3b 0d 09 72 65 74 75 |r)window|);..retu|
|000035b0| 72 6e 20 77 69 6e 64 6f | 77 3b 0d 7d 0d 0d 76 6f |rn windo|w;.}..vo|
|000035c0| 69 64 20 47 44 47 72 61 | 79 43 6f 6c 6f 72 54 61 |id GDGra|yColorTa|
|000035d0| 62 6c 65 28 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |ble(GDHa|ndle dev|
|000035e0| 69 63 65 29 0d 2f 2f 20 | 67 69 76 65 20 74 68 65 |ice).// |give the|
|000035f0| 20 64 65 76 69 63 65 20 | 61 20 73 74 61 6e 64 61 | device |a standa|
|00003600| 72 64 20 67 72 61 79 20 | 63 6f 6c 6f 72 20 74 61 |rd gray |color ta|
|00003610| 62 6c 65 0d 7b 0d 09 43 | 6f 6c 6f 72 54 61 62 6c |ble.{..C|olorTabl|
|00003620| 65 20 2a 2a 74 61 62 6c | 65 3b 0d 09 50 69 78 4d |e **tabl|e;..PixM|
|00003630| 61 70 20 2a 2a 70 6d 3b | 0d 09 69 6e 74 20 69 64 |ap **pm;|..int id|
|00003640| 3b 0d 0d 09 69 66 28 64 | 65 76 69 63 65 3d 3d 4e |;...if(d|evice==N|
|00003650| 55 4c 4c 29 72 65 74 75 | 72 6e 3b 0d 09 70 6d 3d |ULL)retu|rn;..pm=|
|00003660| 28 2a 2a 64 65 76 69 63 | 65 29 2e 67 64 50 4d 61 |(**devic|e).gdPMa|
|00003670| 70 3b 0d 09 74 61 62 6c | 65 3d 28 2a 2a 70 6d 29 |p;..tabl|e=(**pm)|
|00003680| 2e 70 6d 54 61 62 6c 65 | 3b 0d 09 69 64 3d 28 2a |.pmTable|;..id=(*|
|00003690| 2a 70 6d 29 2e 70 69 78 | 65 6c 53 69 7a 65 3b 0d |*pm).pix|elSize;.|
|000036a0| 09 69 66 28 69 64 3e 32 | 29 69 64 2b 3d 33 32 3b |.if(id>2|)id+=32;|
|000036b0| 0d 09 69 66 28 28 2a 2a | 64 65 76 69 63 65 29 2e |..if((**|device).|
|000036c0| 67 64 54 79 70 65 3d 3d | 63 6c 75 74 54 79 70 65 |gdType==|clutType|
|000036d0| 20 26 26 20 28 2a 2a 74 | 61 62 6c 65 29 2e 63 74 | && (**t|able).ct|
|000036e0| 53 65 65 64 21 3d 69 64 | 29 7b 0d 09 09 2f 2f 20 |Seed!=id|){...// |
|000036f0| 47 69 76 65 20 74 68 65 | 20 64 65 76 69 63 65 20 |Give the| device |
|00003700| 61 20 73 74 61 6e 64 61 | 72 64 20 67 72 61 79 2d |a standa|rd gray-|
|00003710| 72 61 6d 70 20 63 6f 6c | 6f 72 20 74 61 62 6c 65 |ramp col|or table|
|00003720| 0d 09 09 74 61 62 6c 65 | 3d 47 65 74 43 54 61 62 |...table|=GetCTab|
|00003730| 6c 65 28 28 2a 2a 70 6d | 29 2e 70 69 78 65 6c 53 |le((**pm|).pixelS|
|00003740| 69 7a 65 2b 33 32 29 3b | 09 2f 2f 20 67 72 61 79 |ize+32);|.// gray|
|00003750| 20 72 61 6d 70 0d 09 09 | 61 73 73 65 72 74 28 74 | ramp...|assert(t|
|00003760| 61 62 6c 65 21 3d 4e 55 | 4c 4c 29 3b 0d 09 09 61 |able!=NU|LL);...a|
|00003770| 73 73 65 72 74 28 28 2a | 2a 28 2a 2a 70 6d 29 2e |ssert((*|*(**pm).|
|00003780| 70 6d 54 61 62 6c 65 29 | 2e 63 74 53 69 7a 65 3d |pmTable)|.ctSize=|
|00003790| 3d 28 2a 2a 74 61 62 6c | 65 29 2e 63 74 53 69 7a |=(**tabl|e).ctSiz|
|000037a0| 65 29 3b 0d 09 09 6d 65 | 6d 63 70 79 28 2a 28 2a |e);...me|mcpy(*(*|
|000037b0| 2a 70 6d 29 2e 70 6d 54 | 61 62 6c 65 2c 2a 74 61 |*pm).pmT|able,*ta|
|000037c0| 62 6c 65 2c 38 2b 28 28 | 2a 2a 74 61 62 6c 65 29 |ble,8+((|**table)|
|000037d0| 2e 63 74 53 69 7a 65 2b | 31 29 2a 73 69 7a 65 6f |.ctSize+|1)*sizeo|
|000037e0| 66 28 43 6f 6c 6f 72 53 | 70 65 63 29 29 3b 0d 09 |f(ColorS|pec));..|
|000037f0| 09 44 69 73 70 6f 73 65 | 48 61 6e 64 6c 65 28 28 |.Dispose|Handle((|
|00003800| 48 61 6e 64 6c 65 29 74 | 61 62 6c 65 29 3b 0d 09 |Handle)t|able);..|
|00003810| 09 74 61 62 6c 65 3d 28 | 2a 2a 70 6d 29 2e 70 6d |.table=(|**pm).pm|
|00003820| 54 61 62 6c 65 3b 0d 09 | 09 28 2a 2a 74 61 62 6c |Table;..|.(**tabl|
|00003830| 65 29 2e 63 74 46 6c 61 | 67 73 7c 3d 30 78 38 30 |e).ctFla|gs|=0x80|
|00003840| 30 30 3b 09 2f 2f 20 6d | 61 72 6b 20 61 73 20 62 |00;.// m|ark as b|
|00003850| 65 6c 6f 6e 67 69 6e 67 | 20 74 6f 20 61 20 64 65 |elonging| to a de|
|00003860| 76 69 63 65 0d 09 09 47 | 44 65 76 69 63 65 43 68 |vice...G|DeviceCh|
|00003870| 61 6e 67 65 64 28 64 65 | 76 69 63 65 29 3b 0d 09 |anged(de|vice);..|
|00003880| 7d 0d 7d 0d 0d 76 6f 69 | 64 20 47 44 44 69 73 70 |}.}..voi|d GDDisp|
|00003890| 6f 73 65 57 69 6e 64 6f | 77 28 43 57 69 6e 64 6f |oseWindo|w(CWindo|
|000038a0| 77 50 74 72 20 77 69 6e | 64 6f 77 29 0d 2f 2f 20 |wPtr win|dow).// |
|000038b0| 44 69 73 70 6f 73 65 20 | 6f 66 20 77 69 6e 64 6f |Dispose |of windo|
|000038c0| 77 20 61 6e 64 20 70 61 | 6c 65 74 74 65 20 61 6e |w and pa|lette an|
|000038d0| 64 20 72 65 73 74 6f 72 | 65 20 74 68 65 20 73 63 |d restor|e the sc|
|000038e0| 72 65 65 6e 27 73 20 63 | 6c 75 74 20 61 6e 64 20 |reen's c|lut and |
|000038f0| 63 6c 69 70 70 69 6e 67 | 2e 0d 7b 0d 09 47 44 48 |clipping|..{..GDH|
|00003900| 61 6e 64 6c 65 20 64 65 | 76 69 63 65 3b 0d 09 0d |andle de|vice;...|
|00003910| 09 69 66 28 77 69 6e 64 | 6f 77 3d 3d 4e 55 4c 4c |.if(wind|ow==NULL|
|00003920| 29 72 65 74 75 72 6e 3b | 0d 09 52 65 6d 6f 76 65 |)return;|..Remove|
|00003930| 50 61 6c 65 74 74 65 28 | 28 57 69 6e 64 6f 77 50 |Palette(|(WindowP|
|00003940| 74 72 29 77 69 6e 64 6f | 77 29 3b 0d 09 23 69 66 |tr)windo|w);..#if|
|00003950| 20 4d 41 4b 45 5f 43 4f | 4c 4f 52 5f 54 41 42 4c | MAKE_CO|LOR_TABL|
|00003960| 45 0d 09 09 44 69 73 70 | 6f 73 48 61 6e 64 6c 65 |E...Disp|osHandle|
|00003970| 28 28 48 61 6e 64 6c 65 | 29 28 2a 28 28 43 47 72 |((Handle|)(*((CGr|
|00003980| 61 66 50 74 72 29 77 69 | 6e 64 6f 77 29 2d 3e 70 |afPtr)wi|ndow)->p|
|00003990| 6f 72 74 50 69 78 4d 61 | 70 29 2d 3e 70 6d 54 61 |ortPixMa|p)->pmTa|
|000039a0| 62 6c 65 29 3b 0d 09 23 | 65 6e 64 69 66 0d 09 64 |ble);..#|endif..d|
|000039b0| 65 76 69 63 65 3d 47 65 | 74 57 69 6e 64 6f 77 44 |evice=Ge|tWindowD|
|000039c0| 65 76 69 63 65 28 28 57 | 69 6e 64 6f 77 50 74 72 |evice((W|indowPtr|
|000039d0| 29 77 69 6e 64 6f 77 29 | 3b 0d 09 44 69 73 70 6f |)window)|;..Dispo|
|000039e0| 73 65 57 69 6e 64 6f 77 | 28 28 57 69 6e 64 6f 77 |seWindow|((Window|
|000039f0| 50 74 72 29 77 69 6e 64 | 6f 77 29 3b 0d 09 69 66 |Ptr)wind|ow);..if|
|00003a00| 28 64 65 76 69 63 65 3d | 3d 4e 55 4c 4c 29 72 65 |(device=|=NULL)re|
|00003a10| 74 75 72 6e 3b 0d 09 47 | 44 52 65 73 74 6f 72 65 |turn;..G|DRestore|
|00003a20| 47 61 6d 6d 61 28 64 65 | 76 69 63 65 29 3b 0d 09 |Gamma(de|vice);..|
|00003a30| 47 44 52 65 73 74 6f 72 | 65 44 65 76 69 63 65 43 |GDRestor|eDeviceC|
|00003a40| 6c 75 74 28 64 65 76 69 | 63 65 29 3b 0d 09 52 65 |lut(devi|ce);..Re|
|00003a50| 73 74 6f 72 65 53 63 72 | 65 65 6e 43 6c 69 70 70 |storeScr|eenClipp|
|00003a60| 69 6e 67 28 64 65 76 69 | 63 65 29 3b 0d 7d 0d 0d |ing(devi|ce);.}..|
|00003a70| 76 6f 69 64 20 41 64 64 | 45 78 70 6c 69 63 69 74 |void Add|Explicit|
|00003a80| 50 61 6c 65 74 74 65 28 | 57 69 6e 64 6f 77 50 74 |Palette(|WindowPt|
|00003a90| 72 20 77 69 6e 64 6f 77 | 29 0d 2f 2f 20 43 72 65 |r window|).// Cre|
|00003aa0| 61 74 65 20 61 20 70 61 | 6c 65 74 74 65 20 66 6f |ate a pa|lette fo|
|00003ab0| 72 20 74 68 65 20 63 6f | 6c 6f 72 20 77 69 6e 64 |r the co|lor wind|
|00003ac0| 6f 77 20 61 6e 64 20 6d | 61 72 6b 20 61 6c 6c 20 |ow and m|ark all |
|00003ad0| 74 68 65 20 65 6e 74 72 | 69 65 73 20 61 73 20 65 |the entr|ies as e|
|00003ae0| 78 70 6c 69 63 69 74 2e | 0d 2f 2f 20 43 6f 70 79 |xplicit.|.// Copy|
|00003af0| 20 74 68 65 20 65 6e 74 | 72 69 65 73 20 66 72 6f | the ent|ries fro|
|00003b00| 6d 20 74 68 65 20 77 69 | 6e 64 6f 77 27 73 20 64 |m the wi|ndow's d|
|00003b10| 65 76 69 63 65 2e 0d 7b | 0d 09 47 44 48 61 6e 64 |evice..{|..GDHand|
|00003b20| 6c 65 20 64 65 76 69 63 | 65 3b 0d 09 43 54 61 62 |le devic|e;..CTab|
|00003b30| 48 61 6e 64 6c 65 20 63 | 74 3b 0d 09 50 61 6c 65 |Handle c|t;..Pale|
|00003b40| 74 74 65 48 61 6e 64 6c | 65 20 70 61 6c 65 74 74 |tteHandl|e palett|
|00003b50| 65 3b 0d 09 69 6e 74 20 | 63 6f 6c 6f 72 73 3b 0d |e;..int |colors;.|
|00003b60| 09 23 69 66 20 4d 41 4b | 45 5f 43 4f 4c 4f 52 5f |.#if MAK|E_COLOR_|
|00003b70| 54 41 42 4c 45 0d 09 09 | 69 6e 74 20 69 2c 65 72 |TABLE...|int i,er|
|00003b80| 72 6f 72 3b 0d 09 23 65 | 6e 64 69 66 0d 0d 09 69 |ror;..#e|ndif...i|
|00003b90| 66 28 77 69 6e 64 6f 77 | 3d 3d 4e 55 4c 4c 29 72 |f(window|==NULL)r|
|00003ba0| 65 74 75 72 6e 3b 0d 09 | 69 66 28 28 28 43 47 72 |eturn;..|if(((CGr|
|00003bb0| 61 66 50 74 72 29 77 69 | 6e 64 6f 77 29 2d 3e 70 |afPtr)wi|ndow)->p|
|00003bc0| 6f 72 74 56 65 72 73 69 | 6f 6e 3e 3d 30 29 20 72 |ortVersi|on>=0) r|
|00003bd0| 65 74 75 72 6e 3b 09 2f | 2f 20 4e 6f 74 20 61 20 |eturn;./|/ Not a |
|00003be0| 63 6f 6c 6f 72 20 77 69 | 6e 64 6f 77 2c 20 72 65 |color wi|ndow, re|
|00003bf0| 74 75 72 6e 2e 0d 09 64 | 65 76 69 63 65 3d 47 65 |turn...d|evice=Ge|
|00003c00| 74 57 69 6e 64 6f 77 44 | 65 76 69 63 65 28 77 69 |tWindowD|evice(wi|
|00003c10| 6e 64 6f 77 29 3b 0d 09 | 69 66 28 64 65 76 69 63 |ndow);..|if(devic|
|00003c20| 65 3d 3d 4e 55 4c 4c 29 | 50 72 69 6e 74 66 45 78 |e==NULL)|PrintfEx|
|00003c30| 69 74 28 0d 09 09 22 41 | 64 64 45 78 70 6c 69 63 |it(..."A|ddExplic|
|00003c40| 69 74 50 61 6c 65 74 74 | 65 3a 20 77 69 6e 64 6f |itPalett|e: windo|
|00003c50| 77 20 68 61 73 20 6e 6f | 20 64 65 76 69 63 65 21 |w has no| device!|
|00003c60| 20 25 73 20 6c 69 6e 65 | 20 25 64 2e 5c 6e 22 2c | %s line| %d.\n",|
|00003c70| 5f 5f 46 49 4c 45 5f 5f | 2c 5f 5f 4c 49 4e 45 5f |__FILE__|,__LINE_|
|00003c80| 5f 29 3b 0d 09 63 74 3d | 28 2a 2a 28 2a 2a 64 65 |_);..ct=|(**(**de|
|00003c90| 76 69 63 65 29 2e 67 64 | 50 4d 61 70 29 2e 70 6d |vice).gd|PMap).pm|
|00003ca0| 54 61 62 6c 65 3b 0d 09 | 63 6f 6c 6f 72 73 3d 28 |Table;..|colors=(|
|00003cb0| 2a 63 74 29 2d 3e 63 74 | 53 69 7a 65 2b 31 3b 0d |*ct)->ct|Size+1;.|
|00003cc0| 09 23 69 66 20 4d 41 4b | 45 5f 43 4f 4c 4f 52 5f |.#if MAK|E_COLOR_|
|00003cd0| 54 41 42 4c 45 0d 09 09 | 65 72 72 6f 72 3d 48 61 |TABLE...|error=Ha|
|00003ce0| 6e 64 54 6f 48 61 6e 64 | 28 28 48 61 6e 64 6c 65 |ndToHand|((Handle|
|00003cf0| 20 2a 29 26 63 74 29 3b | 0d 09 09 69 66 28 65 72 | *)&ct);|...if(er|
|00003d00| 72 6f 72 29 50 72 69 6e | 74 66 45 78 69 74 28 22 |ror)Prin|tfExit("|
|00003d10| 25 73 20 6c 69 6e 65 20 | 25 64 3a 20 65 72 72 6f |%s line |%d: erro|
|00003d20| 72 20 25 64 20 69 6e 20 | 63 6f 70 79 69 6e 67 20 |r %d in |copying |
|00003d30| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 5c 6e 22 0d 09 |color ta|ble\n"..|
|00003d40| 09 09 2c 5f 5f 46 49 4c | 45 5f 5f 2c 5f 5f 4c 49 |..,__FIL|E__,__LI|
|00003d50| 4e 45 5f 5f 2c 65 72 72 | 6f 72 29 3b 0d 09 09 28 |NE__,err|or);...(|
|00003d60| 2a 63 74 29 2d 3e 63 74 | 46 6c 61 67 73 20 26 3d |*ct)->ct|Flags &=|
|00003d70| 20 30 78 37 66 66 66 3b | 09 2f 2f 20 63 6c 65 61 | 0x7fff;|.// clea|
|00003d80| 72 20 22 64 65 76 69 63 | 65 22 20 62 69 74 0d 09 |r "devic|e" bit..|
|00003d90| 09 66 6f 72 28 69 3d 30 | 3b 69 3c 63 6f 6c 6f 72 |.for(i=0|;i<color|
|00003da0| 73 3b 69 2b 2b 29 20 28 | 2a 63 74 29 2d 3e 63 74 |s;i++) (|*ct)->ct|
|00003db0| 54 61 62 6c 65 5b 69 5d | 2e 76 61 6c 75 65 3d 69 |Table[i]|.value=i|
|00003dc0| 3b 0d 09 09 28 2a 63 74 | 29 2d 3e 63 74 53 65 65 |;...(*ct|)->ctSee|
|00003dd0| 64 3d 47 65 74 43 54 53 | 65 65 64 28 29 3b 0d 09 |d=GetCTS|eed();..|
|00003de0| 09 28 2a 28 28 43 47 72 | 61 66 50 74 72 29 77 69 |.(*((CGr|afPtr)wi|
|00003df0| 6e 64 6f 77 29 2d 3e 70 | 6f 72 74 50 69 78 4d 61 |ndow)->p|ortPixMa|
|00003e00| 70 29 2d 3e 70 6d 54 61 | 62 6c 65 3d 63 74 3b 0d |p)->pmTa|ble=ct;.|
|00003e10| 09 23 65 6e 64 69 66 0d | 09 70 61 6c 65 74 74 65 |.#endif.|.palette|
|00003e20| 3d 4e 65 77 50 61 6c 65 | 74 74 65 28 63 6f 6c 6f |=NewPale|tte(colo|
|00003e30| 72 73 2c 63 74 2c 70 6d | 45 78 70 6c 69 63 69 74 |rs,ct,pm|Explicit|
|00003e40| 2b 70 6d 54 6f 6c 65 72 | 61 6e 74 2c 30 29 3b 0d |+pmToler|ant,0);.|
|00003e50| 09 53 65 74 50 61 6c 65 | 74 74 65 28 77 69 6e 64 |.SetPale|tte(wind|
|00003e60| 6f 77 2c 70 61 6c 65 74 | 74 65 2c 30 29 3b 0d 7d |ow,palet|te,0);.}|
|00003e70| 0d 0d 2f 2a 0d 52 65 6d | 6f 76 65 50 61 6c 65 74 |../*.Rem|ovePalet|
|00003e80| 74 65 20 6d 61 79 20 6c | 6f 6f 6b 20 64 61 6e 67 |te may l|ook dang|
|00003e90| 65 72 6f 75 73 2e 20 49 | 20 77 6f 72 72 69 65 64 |erous. I| worried|
|00003ea0| 20 74 68 61 74 20 74 68 | 65 20 57 69 6e 64 6f 77 | that th|e Window|
|00003eb0| 20 6f 72 0d 50 61 6c 65 | 74 74 65 20 4d 61 6e 61 | or.Pale|tte Mana|
|00003ec0| 67 65 72 20 6d 69 67 68 | 74 20 62 65 63 6f 6d 65 |ger migh|t become|
|00003ed0| 20 63 6f 6e 66 75 73 65 | 64 20 69 66 20 69 74 20 | confuse|d if it |
|00003ee0| 6c 61 74 65 72 20 74 72 | 69 65 73 20 74 6f 20 61 |later tr|ies to a|
|00003ef0| 63 63 65 73 73 20 74 68 | 65 0d 77 69 6e 64 6f 77 |ccess th|e.window|
|00003f00| 27 73 20 70 61 6c 65 74 | 74 65 2c 20 77 68 69 63 |'s palet|te, whic|
|00003f10| 68 20 6e 6f 20 6c 6f 6e | 67 65 72 20 65 78 69 73 |h no lon|ger exis|
|00003f20| 74 73 2e 20 48 6f 77 65 | 76 65 72 2c 20 62 79 20 |ts. Howe|ver, by |
|00003f30| 74 72 69 61 6c 20 61 6e | 64 20 65 72 72 6f 72 0d |trial an|d error.|
|00003f40| 49 27 76 65 20 66 6f 75 | 6e 64 20 74 68 61 74 20 |I've fou|nd that |
|00003f50| 74 68 69 73 20 77 6f 72 | 6b 73 20 66 69 6e 65 2c |this wor|ks fine,|
|00003f60| 20 61 6e 64 20 74 68 61 | 74 20 6d 79 20 61 74 74 | and tha|t my att|
|00003f70| 65 6d 70 74 73 20 74 6f | 20 6d 61 6b 65 20 65 78 |empts to| make ex|
|00003f80| 70 6c 69 63 69 74 20 74 | 68 65 0d 66 61 63 74 20 |plicit t|he.fact |
|00003f90| 74 68 61 74 20 74 68 65 | 20 70 61 6c 65 74 74 65 |that the| palette|
|00003fa0| 20 69 73 20 67 6f 6e 65 | 2c 20 65 2e 67 2e 20 62 | is gone|, e.g. b|
|00003fb0| 79 20 63 61 6c 6c 69 6e | 67 20 53 65 74 50 61 6c |y callin|g SetPal|
|00003fc0| 65 74 74 65 28 77 69 6e | 64 6f 77 2c 4e 55 4c 4c |ette(win|dow,NULL|
|00003fd0| 2c 30 29 2c 0d 61 6c 6c | 20 70 72 6f 64 75 63 65 |,0),.all| produce|
|00003fe0| 64 20 63 72 61 73 68 65 | 73 2e 20 49 20 63 6f 6e |d crashe|s. I con|
|00003ff0| 63 6c 75 64 65 20 74 68 | 61 74 20 74 68 65 20 50 |clude th|at the P|
|00004000| 61 6c 65 74 74 65 20 6f | 72 20 57 69 6e 64 6f 77 |alette o|r Window|
|00004010| 20 4d 61 6e 61 67 65 72 | 20 6d 6f 6e 69 74 6f 72 | Manager| monitor|
|00004020| 73 0d 74 68 65 20 63 61 | 6c 6c 73 20 74 6f 20 44 |s.the ca|lls to D|
|00004030| 69 73 70 6f 73 65 50 61 | 6c 65 74 74 65 20 61 6e |isposePa|lette an|
|00004040| 64 20 74 68 75 73 20 6b | 6e 6f 77 73 20 74 68 61 |d thus k|nows tha|
|00004050| 74 20 74 68 65 20 70 61 | 6c 65 74 74 65 20 69 73 |t the pa|lette is|
|00004060| 20 67 6f 6e 65 2e 0d 2a | 2f 0d 76 6f 69 64 20 52 | gone..*|/.void R|
|00004070| 65 6d 6f 76 65 50 61 6c | 65 74 74 65 28 57 69 6e |emovePal|ette(Win|
|00004080| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 29 0d 7b |dowPtr w|indow).{|
|00004090| 0d 09 69 66 28 77 69 6e | 64 6f 77 3d 3d 4e 55 4c |..if(win|dow==NUL|
|000040a0| 4c 29 72 65 74 75 72 6e | 3b 0d 09 44 69 73 70 6f |L)return|;..Dispo|
|000040b0| 73 65 50 61 6c 65 74 74 | 65 28 47 65 74 50 61 6c |sePalett|e(GetPal|
|000040c0| 65 74 74 65 28 77 69 6e | 64 6f 77 29 29 3b 0d 7d |ette(win|dow));.}|
|000040d0| 0d 0d 76 6f 69 64 20 53 | 77 61 70 57 69 6e 64 6f |..void S|wapWindo|
|000040e0| 77 45 78 70 6c 69 63 69 | 74 4d 6f 64 65 28 43 57 |wExplici|tMode(CW|
|000040f0| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 6f 77 2c |indowPtr| window,|
|00004100| 42 6f 6f 6c 65 61 6e 20 | 2a 65 78 70 6c 69 63 69 |Boolean |*explici|
|00004110| 74 29 0d 2f 2f 20 47 65 | 74 20 61 6e 64 20 73 65 |t).// Ge|t and se|
|00004120| 74 20 62 69 74 20 31 34 | 20 6f 66 20 74 68 65 20 |t bit 14| of the |
|00004130| 63 74 46 6c 61 67 73 20 | 66 69 65 6c 64 20 6f 66 |ctFlags |field of|
|00004140| 20 74 68 65 20 77 69 6e | 64 6f 77 27 73 20 63 6f | the win|dow's co|
|00004150| 6c 6f 72 20 74 61 62 6c | 65 2e 0d 2f 2f 20 54 68 |lor tabl|e..// Th|
|00004160| 69 73 20 69 73 20 6f 6e | 6c 79 20 72 65 6c 65 76 |is is on|ly relev|
|00004170| 61 6e 74 20 74 6f 20 61 | 20 43 6f 70 79 42 69 74 |ant to a| CopyBit|
|00004180| 73 20 66 72 6f 6d 20 61 | 6e 20 6f 66 66 73 63 72 |s from a|n offscr|
|00004190| 65 65 6e 0d 2f 2f 20 67 | 72 61 70 68 69 63 73 20 |een.// g|raphics |
|000041a0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 2c 20 62 65 20 |environm|ent, be |
|000041b0| 69 74 20 50 69 78 4d 61 | 70 20 6f 72 20 47 57 6f |it PixMa|p or GWo|
|000041c0| 72 6c 64 2c 20 74 6f 20 | 61 6e 20 6f 6e 73 63 72 |rld, to |an onscr|
|000041d0| 65 65 6e 20 77 69 6e 64 | 6f 77 2e 0d 2f 2f 20 53 |een wind|ow..// S|
|000041e0| 65 65 20 49 6e 73 69 64 | 65 20 4d 61 63 20 56 49 |ee Insid|e Mac VI|
|000041f0| 2c 20 70 61 67 65 20 32 | 30 2d 31 37 2e 20 54 6f |, page 2|0-17. To|
|00004200| 20 67 65 74 20 74 68 65 | 20 66 75 6c 6c 20 73 74 | get the| full st|
|00004210| 6f 72 79 20 73 65 65 20 | 22 43 6f 70 79 42 69 74 |ory see |"CopyBit|
|00004220| 73 20 73 6c 61 76 69 73 | 68 6c 79 22 20 69 6e 20 |s slavis|hly" in |
|00004230| 0d 2f 2f 20 56 69 64 65 | 6f 54 6f 6f 6c 62 6f 78 |.// Vide|oToolbox|
|00004240| 3a 4e 6f 74 65 73 2e 0d | 7b 0d 09 69 6e 74 20 69 |:Notes..|{..int i|
|00004250| 2c 6f 6b 3b 0d 09 43 6f | 6c 6f 72 54 61 62 6c 65 |,ok;..Co|lorTable|
|00004260| 20 2a 2a 63 74 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 | **ct;..|Boolean |
|00004270| 6f 6c 64 45 78 70 6c 69 | 63 69 74 3b 0d 0d 09 69 |oldExpli|cit;...i|
|00004280| 66 28 77 69 6e 64 6f 77 | 3d 3d 4e 55 4c 4c 29 72 |f(window|==NULL)r|
|00004290| 65 74 75 72 6e 3b 0d 09 | 2f 2f 20 49 66 20 69 74 |eturn;..|// If it|
|000042a0| 27 73 20 61 20 47 57 6f | 72 6c 64 50 74 72 20 74 |'s a GWo|rldPtr t|
|000042b0| 68 65 6e 20 77 65 20 6d | 75 73 74 20 6c 6f 63 6b |hen we m|ust lock|
|000042c0| 20 74 68 65 20 70 69 78 | 65 6c 73 20 74 6f 20 61 | the pix|els to a|
|000042d0| 63 63 65 73 73 20 74 68 | 65 20 70 69 78 6d 61 70 |ccess th|e pixmap|
|000042e0| 2e 0d 09 69 66 28 28 77 | 69 6e 64 6f 77 2d 3e 70 |...if((w|indow->p|
|000042f0| 6f 72 74 56 65 72 73 69 | 6f 6e 26 30 78 63 30 30 |ortVersi|on&0xc00|
|00004300| 31 29 3d 3d 30 78 63 30 | 30 31 29 7b 0d 09 09 6f |1)==0xc0|01){...o|
|00004310| 6b 3d 4c 6f 63 6b 50 69 | 78 65 6c 73 28 47 65 74 |k=LockPi|xels(Get|
|00004320| 47 57 6f 72 6c 64 50 69 | 78 4d 61 70 28 77 69 6e |GWorldPi|xMap(win|
|00004330| 64 6f 77 29 29 3b 0d 09 | 09 69 66 28 21 6f 6b 29 |dow));..|.if(!ok)|
|00004340| 72 65 74 75 72 6e 3b 0d | 09 7d 0d 09 63 74 3d 28 |return;.|.}..ct=(|
|00004350| 2a 77 69 6e 64 6f 77 2d | 3e 70 6f 72 74 50 69 78 |*window-|>portPix|
|00004360| 4d 61 70 29 2d 3e 70 6d | 54 61 62 6c 65 3b 0d 09 |Map)->pm|Table;..|
|00004370| 6f 6c 64 45 78 70 6c 69 | 63 69 74 3d 28 28 2a 63 |oldExpli|cit=((*c|
|00004380| 74 29 2d 3e 63 74 46 6c | 61 67 73 26 30 78 34 30 |t)->ctFl|ags&0x40|
|00004390| 30 30 29 21 3d 30 3b 0d | 09 69 66 28 2a 65 78 70 |00)!=0;.|.if(*exp|
|000043a0| 6c 69 63 69 74 29 7b 0d | 09 09 28 2a 63 74 29 2d |licit){.|..(*ct)-|
|000043b0| 3e 63 74 46 6c 61 67 73 | 7c 3d 30 78 34 30 30 30 |>ctFlags||=0x4000|
|000043c0| 3b 0d 09 09 66 6f 72 28 | 69 3d 28 2a 63 74 29 2d |;...for(|i=(*ct)-|
|000043d0| 3e 63 74 53 69 7a 65 3b | 69 3e 3d 30 3b 69 2d 2d |>ctSize;|i>=0;i--|
|000043e0| 29 28 2a 63 74 29 2d 3e | 63 74 54 61 62 6c 65 5b |)(*ct)->|ctTable[|
|000043f0| 69 5d 2e 76 61 6c 75 65 | 3d 69 3b 0d 09 7d 65 6c |i].value|=i;..}el|
|00004400| 73 65 7b 0d 09 09 28 2a | 63 74 29 2d 3e 63 74 46 |se{...(*|ct)->ctF|
|00004410| 6c 61 67 73 26 3d 7e 30 | 78 34 30 30 30 3b 0d 09 |lags&=~0|x4000;..|
|00004420| 7d 0d 09 2a 65 78 70 6c | 69 63 69 74 3d 6f 6c 64 |}..*expl|icit=old|
|00004430| 45 78 70 6c 69 63 69 74 | 3b 0d 7d 0d 0d 2f 2f 20 |Explicit|;.}..// |
|00004440| 43 41 55 54 49 4f 4e 3a | 20 54 68 65 20 50 69 78 |CAUTION:| The Pix|
|00004450| 4d 61 70 20 68 61 6e 64 | 6c 65 73 20 61 72 65 20 |Map hand|les are |
|00004460| 6e 6f 74 20 6c 6f 63 6b | 65 64 2e 20 53 6f 20 64 |not lock|ed. So d|
|00004470| 6f 6e 27 74 20 6d 6f 76 | 65 20 6d 65 6d 6f 72 79 |on't mov|e memory|
|00004480| 2e 20 54 68 65 0d 2f 2f | 20 72 65 74 75 72 6e 65 |. The.//| returne|
|00004490| 64 20 70 6f 69 6e 74 65 | 72 73 20 77 69 6c 6c 20 |d pointe|rs will |
|000044a0| 62 65 63 6f 6d 65 20 69 | 6e 76 61 6c 69 64 20 61 |become i|nvalid a|
|000044b0| 73 20 73 6f 6f 6e 20 61 | 73 20 79 6f 75 20 63 61 |s soon a|s you ca|
|000044c0| 6c 6c 20 61 6e 79 20 72 | 6f 75 74 69 6e 65 0d 2f |ll any r|outine./|
|000044d0| 2f 20 74 68 61 74 20 6d | 6f 76 65 73 20 6d 65 6d |/ that m|oves mem|
|000044e0| 6f 72 79 2e 20 43 6f 70 | 79 42 69 74 73 20 61 6e |ory. Cop|yBits an|
|000044f0| 64 20 43 6f 70 79 42 69 | 74 73 51 75 69 63 6b 6c |d CopyBi|tsQuickl|
|00004500| 79 20 61 72 65 20 6f 6b | 2e 0d 42 69 74 4d 61 70 |y are ok|..BitMap|
|00004510| 20 2a 47 65 74 42 69 74 | 4d 61 70 50 74 72 28 43 | *GetBit|MapPtr(C|
|00004520| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|00004530| 29 0d 7b 0d 09 42 69 74 | 4d 61 70 20 2a 62 69 74 |).{..Bit|Map *bit|
|00004540| 73 3b 0d 09 69 6e 74 20 | 6f 6b 3b 0d 09 50 69 78 |s;..int |ok;..Pix|
|00004550| 4d 61 70 50 74 72 20 2a | 70 6d 3b 0d 0d 09 69 66 |MapPtr *|pm;...if|
|00004560| 28 49 73 47 57 6f 72 6c | 64 50 74 72 28 77 69 6e |(IsGWorl|dPtr(win|
|00004570| 64 6f 77 29 29 7b 0d 09 | 09 2f 2f 20 49 74 27 73 |dow)){..|.// It's|
|00004580| 20 61 20 47 57 6f 72 6c | 64 50 74 72 2c 20 6c 6f | a GWorl|dPtr, lo|
|00004590| 63 6b 20 74 68 65 20 70 | 69 78 65 6c 73 2c 20 72 |ck the p|ixels, r|
|000045a0| 65 74 75 72 6e 20 70 69 | 78 6d 61 70 20 70 74 72 |eturn pi|xmap ptr|
|000045b0| 2e 0d 09 09 6f 6b 3d 4c | 6f 63 6b 50 69 78 65 6c |....ok=L|ockPixel|
|000045c0| 73 28 47 65 74 47 57 6f | 72 6c 64 50 69 78 4d 61 |s(GetGWo|rldPixMa|
|000045d0| 70 28 28 47 57 6f 72 6c | 64 50 74 72 29 77 69 6e |p((GWorl|dPtr)win|
|000045e0| 64 6f 77 29 29 3b 0d 09 | 09 69 66 28 21 6f 6b 29 |dow));..|.if(!ok)|
|000045f0| 72 65 74 75 72 6e 20 4e | 55 4c 4c 3b 0d 09 09 70 |return N|ULL;...p|
|00004600| 6d 3d 47 65 74 47 57 6f | 72 6c 64 50 69 78 4d 61 |m=GetGWo|rldPixMa|
|00004610| 70 28 28 47 57 6f 72 6c | 64 50 74 72 29 77 69 6e |p((GWorl|dPtr)win|
|00004620| 64 6f 77 29 3b 0d 2f 2f | 09 09 48 4c 6f 63 6b 28 |dow);.//|..HLock(|
|00004630| 28 48 61 6e 64 6c 65 29 | 70 6d 29 3b 0d 09 09 62 |(Handle)|pm);...b|
|00004640| 69 74 73 20 3d 20 28 42 | 69 74 4d 61 70 20 2a 29 |its = (B|itMap *)|
|00004650| 2a 70 6d 3b 0d 09 7d 65 | 6c 73 65 20 69 66 28 21 |*pm;..}e|lse if(!|
|00004660| 49 73 47 72 61 66 50 74 | 72 28 77 69 6e 64 6f 77 |IsGrafPt|r(window|
|00004670| 29 29 7b 0d 09 09 70 6d | 3d 77 69 6e 64 6f 77 2d |)){...pm|=window-|
|00004680| 3e 70 6f 72 74 50 69 78 | 4d 61 70 3b 0d 2f 2f 09 |>portPix|Map;.//.|
|00004690| 09 48 4c 6f 63 6b 28 28 | 48 61 6e 64 6c 65 29 70 |.HLock((|Handle)p|
|000046a0| 6d 29 3b 0d 09 09 62 69 | 74 73 20 3d 20 28 42 69 |m);...bi|ts = (Bi|
|000046b0| 74 4d 61 70 20 2a 29 2a | 70 6d 3b 0d 09 7d 65 6c |tMap *)*|pm;..}el|
|000046c0| 73 65 7b 0d 09 09 62 69 | 74 73 20 3d 20 26 28 28 |se{...bi|ts = &((|
|000046d0| 57 69 6e 64 6f 77 50 74 | 72 29 77 69 6e 64 6f 77 |WindowPt|r)window|
|000046e0| 29 2d 3e 70 6f 72 74 42 | 69 74 73 3b 0d 09 7d 0d |)->portB|its;..}.|
|000046f0| 09 72 65 74 75 72 6e 20 | 62 69 74 73 3b 0d 7d 0d |.return |bits;.}.|
|00004700| 0d 42 6f 6f 6c 65 61 6e | 20 49 73 47 57 6f 72 6c |.Boolean| IsGWorl|
|00004710| 64 50 74 72 28 43 57 69 | 6e 64 6f 77 50 74 72 20 |dPtr(CWi|ndowPtr |
|00004720| 77 69 6e 64 6f 77 29 09 | 2f 2f 20 49 73 20 69 74 |window).|// Is it|
|00004730| 20 61 20 47 57 6f 72 6c | 64 50 74 72 3f 0d 7b 0d | a GWorl|dPtr?.{.|
|00004740| 09 72 65 74 75 72 6e 20 | 28 77 69 6e 64 6f 77 2d |.return |(window-|
|00004750| 3e 70 6f 72 74 56 65 72 | 73 69 6f 6e 26 30 78 63 |>portVer|sion&0xc|
|00004760| 30 30 31 29 20 3d 3d 20 | 30 78 63 30 30 31 3b 0d |001) == |0xc001;.|
|00004770| 7d 0d 0d 0d 42 6f 6f 6c | 65 61 6e 20 49 73 47 72 |}...Bool|ean IsGr|
|00004780| 61 66 50 74 72 28 43 57 | 69 6e 64 6f 77 50 74 72 |afPtr(CW|indowPtr|
|00004790| 20 77 69 6e 64 6f 77 29 | 09 2f 2f 20 49 73 20 69 | window)|.// Is i|
|000047a0| 74 20 61 20 57 69 6e 64 | 6f 77 50 74 72 3f 0d 7b |t a Wind|owPtr?.{|
|000047b0| 0d 09 72 65 74 75 72 6e | 20 77 69 6e 64 6f 77 2d |..return| window-|
|000047c0| 3e 70 6f 72 74 56 65 72 | 73 69 6f 6e 3e 3d 30 3b |>portVer|sion>=0;|
|000047d0| 0d 7d 0d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004800| 00 00 01 00 00 00 03 4e | 00 00 02 4e 00 00 00 c2 |.......N|...N....|
|00004810| 44 4c 69 6e 65 61 72 47 | 61 6d 6d 61 28 29 20 61 |DLinearG|amma() a|
|00004820| 6e 64 20 47 44 53 65 74 | 45 6e 74 72 69 65 73 28 |nd GDSet|Entries(|
|00004830| 0e 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 2e 63 6e |.GDOpenW|indow.cn|
|00004840| 02 00 00 00 54 45 58 54 | 43 57 49 45 01 00 00 14 |....TEXT|CWIE....|
|00004850| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 14 01 e0 |..TEXTCW|IE......|
|00004860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004870| 00 00 a1 48 9e 7e 00 00 | 47 54 00 00 04 10 6f 6c |...H.~..|GT....ol|
|00004880| 6f 72 20 4d 61 6e 61 67 | 65 72 2e 20 53 69 6e 63 |or Manag|er. Sinc|
|00004890| 65 0d 74 68 65 20 43 6f | 6c 6f 72 20 61 6e 64 20 |e.the Co|lor and |
|000048a0| 50 61 6c 65 74 74 65 20 | 4d 61 6e 61 67 65 72 73 |Palette |Managers|
|000048b0| 20 64 6f 6e 27 74 20 6b | 6e 6f 77 20 74 68 61 74 | don't k|now that|
|000048c0| 20 79 6f 75 27 76 65 20 | 63 68 61 6e 67 65 64 20 | you've |changed |
|000048d0| 74 68 65 20 63 6f 6c 6f | 72 20 65 6e 76 69 72 6f |the colo|r enviro|
|000048e0| 6e 6d 65 6e 74 0d 74 68 | 65 79 20 63 61 6e 27 74 |nment.th|ey can't|
|000048f0| 20 72 65 61 63 74 20 74 | 6f 20 69 74 2c 20 61 6e | react t|o it, an|
|00004900| 00 00 00 2a 00 09 06 47 | 65 6e 65 76 61 00 00 00 |...*...G|eneva...|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 04 00 06 00 04 00 00 | 00 14 00 00 00 66 00 0e |........|.....f..|
|00004940| ff f4 00 0c ff ff 00 00 | 35 df 00 00 35 e7 00 00 |........|5...5...|
|00004950| 00 1e 00 3d 00 04 01 8c | 02 7c 00 3d 00 04 01 8c |...=....|.|.=....|
|00004960| 02 7c 00 00 3f c3 00 00 | 00 00 00 00 00 00 00 00 |.|..?...|........|
|00004970| 00 00 00 14 00 00 2d 61 | 00 d4 00 00 00 00 00 00 |......-a|........|
|00004980| 31 00 00 f1 00 00 00 00 | 00 00 00 b8 00 07 00 12 |1.......|........|
|00004990| 00 00 2f a2 00 e9 00 50 | f6 a8 00 00 03 69 64 20 |../....P|.....id |
|000049a0| 00 20 00 00 2f 8c 00 e8 | 00 50 f6 98 00 00 11 28 |. ../...|.P.....(|
|000049b0| 2a 2a 70 6d 29 2e 70 69 | 78 65 6c 53 69 7a 65 20 |**pm).pi|xelSize |
|000049c0| 00 20 00 00 2f b3 00 ea | 00 50 f6 88 00 00 11 28 |. ../...|.P.....(|
|000049d0| 2a 2a 74 61 62 6c 65 29 | 2e 63 74 53 65 65 64 20 |**table)|.ctSeed |
|000049e0| 00 14 00 00 30 23 00 ec | 00 50 f6 78 00 00 05 74 |....0#..|.P.x...t|
|000049f0| 61 62 6c 65 00 26 00 00 | 31 00 00 f1 00 50 f5 68 |able.&..|1....P.h|
|00004a00| 80 00 00 46 01 b4 01 1b | 02 7c 94 20 00 00 00 00 |...F....|.|. ....|
|00004a10| 00 00 07 2a 2a 74 61 62 | 6c 65 00 16 00 00 31 00 |...**tab|le....1.|
|00004a20| 00 f1 00 50 f5 6c 00 00 | 07 2a 74 61 62 6c 65 20 |...P.l..|.*table |
|00004a30| 00 14 00 00 31 00 00 f1 | 00 50 f5 40 00 00 05 74 |....1...|.P.@...t|
|00004a40| 61 62 6c 65 00 00 00 b2 | 00 07 00 00 21 4d 00 00 |able....|....!M..|
|00004a50| 21 5f 13 41 64 64 45 78 | 70 6c 69 63 69 74 50 61 |!_.AddEx|plicitPa|
|00004a60| 6c 65 74 74 65 00 00 00 | 19 83 00 00 19 92 0f 47 |lette...|.......G|
|00004a70| 44 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 00 00 |DDispose|Window..|
|00004a80| 1c 75 00 00 1c 85 11 47 | 44 44 69 73 70 6f 73 65 |.u.....G|DDispose|
|00004a90| 57 69 6e 64 6f 77 31 00 | 00 00 19 08 00 00 19 14 |Window1.|........|
|00004aa0| 0d 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 00 00 00 |.GDOpenW|indow...|
|00004ab0| 1a 18 00 00 1a 25 0d 47 | 44 4f 70 65 6e 57 69 6e |.....%.G|DOpenWin|
|00004ac0| 64 6f 77 31 00 00 1f 94 | 00 00 1f aa 17 4d 61 6b |dow1....|.....Mak|
|00004ad0| 65 43 6f 6c 6f 72 54 61 | 62 6c 65 45 78 70 6c 69 |eColorTa|bleExpli|
|00004ae0| 63 69 74 00 00 00 29 f0 | 00 00 29 f7 0d 52 65 6d |cit...).|..)..Rem|
|00004af0| 6f 76 65 50 61 6c 65 74 | 74 65 00 00 00 48 00 09 |ovePalet|te...H..|
|00004b00| 4d 6f 6e 61 63 6f 00 00 | 00 00 00 00 00 00 00 00 |Monaco..|........|
|00004b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b20| 00 03 00 04 00 62 00 0e | 01 f6 02 eb 00 62 00 0e |.....b..|.....b..|
|00004b30| 01 f6 02 eb ad bd 6c 8b | 00 00 2b 9a 00 00 2b a0 |......l.|..+...+.|
|00004b40| 00 00 27 7f 00 00 00 00 | 00 04 00 01 00 01 00 00 |..'.....|........|
|00004b50| 01 00 00 00 03 4e 00 00 | 02 4e 00 00 00 c2 01 21 |.....N..|.N.....!|
|00004b60| e7 60 3d 54 00 00 00 1c | 00 c2 00 06 4d 50 53 52 |.`=T....|....MPSR|
|00004b70| 00 02 00 3a 45 46 4e 54 | 00 00 00 5e 45 54 41 42 |...:EFNT|...^ETAB|
|00004b80| 00 00 00 6a 45 51 45 44 | 00 00 00 76 42 4b 50 54 |...jEQED|...vBKPT|
|00004b90| 00 00 00 82 44 54 56 55 | 00 00 00 8e 4d 57 42 42 |....DTVU|....MWBB|
|00004ba0| 00 00 00 9a 03 f0 ff ff | 00 00 00 4e 00 00 00 00 |........|...N....|
|00004bb0| 03 ef ff ff 00 00 01 44 | 00 00 00 00 03 ed ff ff |.......D|........|
|00004bc0| 00 00 01 fa 00 00 00 00 | 03 eb ff ff 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 03 ec ff ff | 00 00 00 2e 00 00 00 00 |........|........|
|00004be0| 03 eb ff ff 00 00 00 36 | 00 00 00 00 64 65 ff ff |.......6|....de..|
|00004bf0| 00 00 00 70 00 00 00 00 | 1a e8 ff ff 00 00 00 88 |...p....|........|
|00004c00| 00 00 00 00 03 f0 ff ff | 00 00 02 46 00 00 00 00 |........|...F....|
|00004c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+